Custom AOSP Keyboard Error: DictionaryProvider ClassNotFoundException - android-softkeyboard

I'm trying to build the AOSP keyboard from the 5.0.2 branch after adding some custom code to obtain pressure values for key touches. I'm using lunch full-eng to build the source and using mm to build LatinIME after I've added my changes.
I'm then pushing LatinIME to /system/apps/ on my Galaxy S3 after removing the previous version. I'm running an unofficial version of CM12 5.0.2 on the device.
The error I get is below which appears to have nothing to do with my code changes but more likely in the way I'm building the app.
E/AndroidRuntime(12198): FATAL EXCEPTION: main
E/AndroidRuntime(12198): Process: com.android.inputmethod.latin, PID: 12198
E/AndroidRuntime(12198): java.lang.RuntimeException: Unable to get provider com.android.inputmethod.dictionarypack.DictionaryProvider: java.lang.ClassNotFoundException: Didn't find class "com.android.inputmethod.dictionarypack.DictionaryProvider" on path: DexPathList[[zip file "/system/app/LatinIME.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
E/AndroidRuntime(12198): at android.app.ActivityThread.installProvider(ActivityThread.java:4969)
E/AndroidRuntime(12198): at android.app.ActivityThread.installContentProviders(ActivityThread.java:4561)
E/AndroidRuntime(12198): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4501)
E/AndroidRuntime(12198): at android.app.ActivityThread.access$1500(ActivityThread.java:144)
E/AndroidRuntime(12198): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
E/AndroidRuntime(12198): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(12198): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(12198): at android.app.ActivityThread.main(ActivityThread.java:5223)
E/AndroidRuntime(12198): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(12198): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(12198): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
E/AndroidRuntime(12198): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
E/AndroidRuntime(12198): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.inputmethod.dictionarypack.DictionaryProvider" on path: DexPathList[[zip file "/system/app/LatinIME.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
E/AndroidRuntime(12198): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/AndroidRuntime(12198): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
E/AndroidRuntime(12198): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
E/AndroidRuntime(12198): at android.app.ActivityThread.installProvider(ActivityThread.java:4954)
E/AndroidRuntime(12198): ... 11 more
E/AndroidRuntime(12198): Suppressed: java.lang.ClassNotFoundException: com.android.inputmethod.dictionarypack.DictionaryProvider
E/AndroidRuntime(12198): at java.lang.Class.classForName(Native Method)
E/AndroidRuntime(12198): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
E/AndroidRuntime(12198): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
E/AndroidRuntime(12198): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
E/AndroidRuntime(12198): ... 13 more
E/AndroidRuntime(12198): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
I'm new to compiling Android source, so perhaps this is obvious, but should I be building for my specific device instead of using lunch full-eng?
Any help on this issue would be greatly appreciate.

When building platforms apps, most of them are pre-optimized. By adding WITH_DEXPREOPT := false it will build the apk with a dex file inside.
Verify the LatinIME.apk you are pushing to your device has a classes.dex file in it (unzip -l). If it does not, add the WITH_DEXPREOPT to the Android.mk file for LatinIME.

Related

Failed to load p2 repository

Hello I get the following errors when trying to 'maven install' my feature based product:
[ERROR] Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'eclipse-repo' from location https://download.eclipse.org/eclipse/updates/4.20/: Unable to read repository at https://download.eclipse.org/eclipse/updates/4.20/compositeContent.xml. Unable to make public void sun.security.ssl.SSLSocketImpl.setHost(java.lang.String) accessible: module java.base does not "exports sun.security.ssl" to unnamed module #5840a6ee -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'eclipse-repo' from location https://download.eclipse.org/eclipse/updates/4.20/
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:120)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Apart from the suggestions from Unable to read repository at http://download.eclipse.org/releases/indigo I havent found much useful information what might be the reason for the error. Thanks for your help!

Exporting google vr unity sdk master sample file from unity and getting error

Exporting google vr unity SDK master sample file from unity and getting an error like Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
Please see the complete error
Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
C:\Program Files\Java\jdk1.7.0_51\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/Administrator/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at SDKMain.main(SDKMain.java:127)
]
stdout[
]
It seems to be a problem of mismatch between the JDK necessary for the google vr sdk and yours. You might need to update your JDK and Android SDK.
This links found another workaround:
link 1
link 2

Android build failed ionic : Error code 1

I got the following error for the command ionic build android I don't have a clue what this error means. What should be done to rectify this error.I read that it happens if you dont have all the required platforms but I already installed almost all the versions of android along with latest build tools, support repositories and libraries.
-dex:
[dex] input: C:\Users\XXX\Desktop\IonicProjects\Master\platfor
ms\android\ant-build\classes
[dex] input: C:\Users\XXX\Desktop\IonicProjects\Master\platfor
ms\android\CordovaLib\ant-build\classes.jar
[dex] Pre-Dexing C:\Users\XXX\Desktop\IonicProjects\Master\pla
tforms\android\CordovaLib\ant-build\classes.jar -> classes-564f85b75a48715c68c6f
85da336a58d.jar
[dx] java.lang.UnsupportedClassVersionError: com/android/dx/command/Main
: Unsupported major.minor version 52.0
[dx] at java.lang.ClassLoader.defineClass1(Native Method)
[dx] at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
[dx] at java.security.SecureClassLoader.defineClass(SecureClassLoader
.java:142)
[dx] at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
[dx] at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
[dx] at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
[dx] at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[dx] at java.security.AccessController.doPrivileged(Native Method)
[dx] at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[dx] at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
[dx] at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
[dx] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
[dx] at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
[dx] at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.j
ava:482)
[dx] Exception in thread "main"
BUILD FAILED
D:\android-sdk\tools\ant\build.xml:888: The following error occurred while execu
ting this line:
D:\android-sdk\tools\ant\build.xml:890: The following error occurred while execu
ting this line:
D:\android-sdk\tools\ant\build.xml:902: The following error occurred while execu
ting this line:
D:\android-sdk\tools\ant\build.xml:283: null returned: 1
Total time: 13 seconds
C:\Users\XXX\Desktop\IonicProjects\Master\platforms\android\cordova\
node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,C:\Users\XXX\Desktop\IonicProjects\Master\platforms\android\build.xml,-Dout.dir=ant-buil
d,-Dgen.absolute.dir=ant-gen
ERROR running one or more of the platforms: Error: cmd: Command failed with exit
code 1
You may not have the required environment or OS to run this project
Any sort of help or suggestion would be appreciated.
Thanks
Unsupported major.minor version 52.0 indicates that you need at least Java 8 to run the build, so try to update your JDK (Java class file number).

java.lang.ClassNotFoundException: org.slf4j.LoggerFactory Maven

I just installed Maven on Eclipse. If I run the pom.xml, I get the error below.
People who use Windows don't get this error. I have Mac OS X.
When I add slf4j-simple-1.7.5.jr and slf4j-api-1.7.5.jar to the build path, it works.
Is there a way NOT to add external jars?
EDIT 2:
I used Maven clean via Terminal and that worked. I think the problem is Maven internal in Eclipse.
EDIT 3:
I deleted the projects and checked out it all from SVN and it worked somehow.
[INFO] Scanning for projects...
[ERROR] Internal error: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException: org/slf4j/LoggerFactory: org.slf4j.LoggerFactory -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.eclipse.tycho.core.maven.utils.MavenCompatiblityHelper.getPluginDescriptor(MavenCompatiblityHelper.java:86)
at org.eclipse.tycho.core.maven.utils.PluginRealmHelper.execute(PluginRealmHelper.java:95)
at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.getDependencyMetadata(P2TargetPlatformResolver.java:144)
at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.setupProjects(P2TargetPlatformResolver.java:126)
at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.setupProject(DefaultTychoDependencyResolver.java:87)
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:77)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:273)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.tycho.core.maven.utils.MavenCompatiblityHelper.getPluginDescriptor(MavenCompatiblityHelper.java:68)
... 18 more
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at com.ning.http.client.AsyncHttpClient.<clinit>(AsyncHttpClient.java:147)
at org.sonatype.aether.connector.async.AsyncRepositoryConnector.<init>(AsyncRepositoryConnector.java:150)
at org.sonatype.aether.connector.async.AsyncRepositoryConnectorFactory.newInstance(AsyncRepositoryConnectorFactory.java:110)
at org.sonatype.aether.impl.internal.DefaultRemoteRepositoryManager.getRepositoryConnector(DefaultRemoteRepositoryManager.java:333)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:456)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:220)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:197)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:268)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:173)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:316)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:108)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:143)
... 23 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
... 35 more
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException
If your code makes use of slf4j, you'll also have to add the API and one of the implementation jars to your project. So the answer is: no.

ClassNotFoundException with Grails Spock Plugin

I have a Grails 1.3.7 project and but when I installed the Grails Spock Plugin: I got this:
Installed plugin spock-0.5-groovy-1.7 to location /Users/tiffany/.grails/1.3.7/projects/grails-with-spock/plugins/spock-0.5-groovy-1.7. ...
Resolving plugin JAR dependencies ...
[Fatal Error] settings.xml:19:2: The markup in the document following the root element must be well-formed.
WARNING: Dependencies cannot be resolved for plugin [spock] due to error: The markup in the document following the root element must be well-formed.
Executing spock-0.5-groovy-1.7 plugin post-install script ...
Plugin spock-0.5-groovy-1.7 installed
[delete] Deleting directory /Users/tiffany/Workspace/chrome-webstore/grails-with-spock/target/classes
[delete] Deleting directory /Users/tiffany/.grails/1.3.7/projects/grails-with-spock/plugin-classes
[delete] Deleting directory /Users/tiffany/.grails/1.3.7/projects/grails-with-spock/resources
And when I tried running a simple domain UnitSpec, I got this stack trace:
[Fatal Error] settings.xml:19:2: The markup in the document following the root element must be well-formed.
WARNING: Dependencies cannot be resolved for plugin [spock] due to error: The markup in the document following the root element must be well-formed.
Resolving dependencies...
Dependencies resolved in 1284ms.
Running script /Users/tiffany/dev/grails/scripts/TestApp.groovy
Environment set to test
[mkdir] Created dir: /Users/tiffany/.grails/1.3.7/projects/grails-with-spock/plugin-classes
[groovyc] Compiling 2 source files to /Users/tiffany/.grails/1.3.7/projects/grails-with-spock/plugin-classes
[mkdir] Created dir: /Users/tiffany/Workspace/chrome-webstore/grails-with-spock/target/classes
[groovyc] Compiling 7 source files to /Users/tiffany/Workspace/chrome-webstore/grails-with-spock/target/classes
Error executing script TestApp: java.lang.ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType
java.lang.ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:391)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)
Caused by: java.lang.ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java_lang_ClassLoader$loadClass.call(Unknown Source)
at _Events$_run_closure1_closure5.doCall(_Events.groovy:18)
at _Events$_run_closure1.doCall(_Events.groovy:24)
at _Events$_run_closure2.doCall(_Events.groovy:30)
at _Events$_run_closure2.doCall(_Events.groovy)
at _Events$_run_closure3.doCall(_Events.groovy:39)
at org.apache.tools.ant.BuildListener$targetStarted.call(Unknown Source)
at TestApp$_run_closure1.doCall(TestApp.groovy:82)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
... 10 more
--- Nested Exception ---
java.lang.ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java_lang_ClassLoader$loadClass.call(Unknown Source)
at _Events$_run_closure1_closure5.doCall(_Events.groovy:18)
at _Events$_run_closure1.doCall(_Events.groovy:24)
at _Events$_run_closure2.doCall(_Events.groovy:30)
at _Events$_run_closure2.doCall(_Events.groovy)
at _Events$_run_closure3.doCall(_Events.groovy:39)
at org.apache.tools.ant.BuildListener$targetStarted.call(Unknown Source)
at TestApp$_run_closure1.doCall(TestApp.groovy:82)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)
Has anyone encountered this problem before? And if so, how do I resolve this? I've tried googling but I got nothing >.<
I also tried creating a new Grails app and only installed the Spock Plugin, nothing else. I got the exact same result.
Many of these problems can be solved with a simple grails clean or if even that does not help try to delete the .grails folder in your user directory and run the plugin installation again.