问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/28005500/custom-aosp-keyboard-error-dictionaryprovider-classnotfoundexception