AOSP键盘:的NoSuchMethodError - createEmptyDictFileNative [英] AOSP Keyboard: NoSuchMethodError - createEmptyDictFileNative
问题描述
我想加一些定制code,以获得关键的触摸pressure值之后建立从5.0.2分支AOSP键盘。我使用午餐全英
来构建源,并使用毫米
打造LatinIME我已经添加了我的后变化。
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.
我在和pre-优化麻烦,但在这里帮助就如何解决<一个href=\"http://stackoverflow.com/questions/28005500/custom-aosp-keyboard-error-dictionaryprovider-classnotfoundexception\">that.现在我有以下错误:
I was having trouble with pre-optimization but was helped here on how to solve that. I'm now having the following error:
E/dalvikvm( 729): ERROR: couldn't find native method
E/dalvikvm( 729): Requested: Lcom/android/inputmethod/latin/BinaryDictionary;.createEmptyDictFileNative:(Ljava/lang/String;J[Ljava/lang/String;[Ljava/lang/String;)Z
W/dalvikvm( 729): Exception Ljava/lang/NoSuchMethodError; thrown while initializing Lcom/android/inputmethod/latin/utils/JniUtils;
W/dalvikvm( 729): Exception Ljava/lang/NoSuchMethodError; thrown while initializing Lcom/android/inputmethod/latin/LatinIME;
W/dalvikvm( 729): Class init failed in newInstance call (Lcom/android/inputmethod/latin/LatinIME;)
D/AndroidRuntime( 729): Shutting down VM
W/dalvikvm( 729): threadid=1: thread exiting with uncaught exception (group=0x41f1ada0)
E/AndroidRuntime( 729): FATAL EXCEPTION: main
E/AndroidRuntime( 729): Process: com.android.inputmethod.latin, PID: 729
E/AndroidRuntime( 729): java.lang.NoSuchMethodError: no static or non-static method "Lcom/android/inputmethod/latin/BinaryDictionary;.createEmptyDictFileNative(Ljava/lang/String;J[Ljava/lang/String;[Ljava/lang/String;)Z"
E/AndroidRuntime( 729): at java.lang.Runtime.nativeLoad(Native Method)
E/AndroidRuntime( 729): at java.lang.Runtime.doLoad(Runtime.java:435)
E/AndroidRuntime( 729): at java.lang.Runtime.loadLibrary(Runtime.java:363)
E/AndroidRuntime( 729): at java.lang.System.loadLibrary(System.java:526)
E/AndroidRuntime( 729): at com.android.inputmethod.latin.utils.JniUtils.<clinit>(JniUtils.java:28)
E/AndroidRuntime( 729): at com.android.inputmethod.latin.LatinIME.<clinit>(LatinIME.java:513)
E/AndroidRuntime( 729): at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime( 729): at java.lang.Class.newInstance(Class.java:1208)
E/AndroidRuntime( 729): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2723)
E/AndroidRuntime( 729): at android.app.ActivityThread.access$1900(ActivityThread.java:169)
E/AndroidRuntime( 729): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1362)
E/AndroidRuntime( 729): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 729): at android.os.Looper.loop(Looper.java:146)
E/AndroidRuntime( 729): at android.app.ActivityThread.main(ActivityThread.java:5487)
E/AndroidRuntime( 729): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 729): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 729): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
E/AndroidRuntime( 729): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
E/AndroidRuntime( 729): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
E/AndroidRuntime( 729): at dalvik.system.NativeStart.main(Native Method)
LatinIME.java
有以下有关此调用的评论:
LatinIME.java
has the following comment regarding this call:
加载本地库急切地避免意外
的UnsatisfiedLinkError在初始
JNI调用尽可能多的。
Loading the native library eagerly to avoid unexpected UnsatisfiedLinkError at the initial JNI call as much as possible.
和 JniUtils.java
进行呼叫
的System.loadLibrary(JniLibName.JNI_LIB_NAME);
其中, JNI_LIB_NAME
在 com.android.inputmethod.latin.define.JniLibName
假想定义。这是我相信我的问题是部分
where JNI_LIB_NAME
is supposedly defined in com.android.inputmethod.latin.define.JniLibName
. This is where I believe my issue partially is.
-
BinaryDictionary.java
不包含createEmptyDictFileNave
法 -
com.android.inputmethod.latin.define.JniLibName
源$ C $ C,我从谷歌的回购得到了根本不存在。
BinaryDictionary.java
does not contain acreateEmptyDictFileNave
methodcom.android.inputmethod.latin.define.JniLibName
does not exist in the source code I got from Google's repo.
像往常一样,任何帮助将大大pciated因为我很新的Android源建筑AP $ P $。谢谢你。
Like always, any help would be greatly appreciated as I'm very new to Android source building. Thank you.
问候,
伊恩
推荐答案
createEmptyDictFileNative在<一个href=\"http://androidxref.com/5.0.0_r2/xref/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/BinaryDictionaryUtils.java#43\"相对=nofollow> BinaryDictionaryUtils 并JNI_LIB_NAME是<一个href=\"http://androidxref.com/5.0.0_r2/xref/packages/inputmethods/LatinIME/java-overridable/src/com/android/inputmethod/latin/define/JniLibName.java#24\"相对=nofollow>这里。
createEmptyDictFileNative is in BinaryDictionaryUtils and JNI_LIB_NAME is here.
您可能有libjni_latinime.so过时的版本不包含的 createEmptyDictFileNative 的功能导出JNI。
You might have an outdated version of libjni_latinime.so that does not contain the createEmptyDictFileNative function exported for JNI.
拉库,并验证该方法存在:
Pull the library and verify that method exists:
adb pull /system/lib/libjni_latinime.so
nm -D libjni_latinime.so | grep createEmptyDictFile
如果库中不存在,则需要重新安装/系统并进行安装。如果本地方法不存在,则需要更新libjni_latinime.so共享库
If the library doesn't exist, you need to remount /system and install it. If the native method doesn't exist, you need an updated libjni_latinime.so shared library
这篇关于AOSP键盘:的NoSuchMethodError - createEmptyDictFileNative的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!