gpt4 book ai didi

android - 查找库在迁移到平板电脑时返回null

转载 作者:行者123 更新时间:2023-12-02 17:12:45 25 4
gpt4 key购买 nike

我已经编写了一个代码,该代码可以在我的手机上完美运行(具有API 19的三星Galaxy S5)。但是,当我尝试将项目上传到装有Android 4.2.2的平板电脑时,会引发错误。

我使用Eclipse。我清理了所有项目。我在armeabi和armeabi-v7a中有相同的库。

下面是日志:

01-29 11:35:30.955: E/AndroidRuntime(16214): FATAL EXCEPTION: main
01-29 11:35:30.955: E/AndroidRuntime(16214): java.lang.ExceptionInInitializerError
01-29 11:35:30.955: E/AndroidRuntime(16214): at edu.cmu.pocketsphinx.demo.PersonRecognizer.<init>(PersonRecognizer.java:42)
01-29 11:35:30.955: E/AndroidRuntime(16214): at edu.cmu.pocketsphinx.demo.PocketSphinxActivity$1.onManagerConnected(PocketSphinxActivity.java:249)
01-29 11:35:30.955: E/AndroidRuntime(16214): at org.opencv.android.AsyncServiceHelper$1.onServiceConnected(AsyncServiceHelper.java:318)
01-29 11:35:30.955: E/AndroidRuntime(16214): at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1106)
01-29 11:35:30.955: E/AndroidRuntime(16214): at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1123)
01-29 11:35:30.955: E/AndroidRuntime(16214): at android.os.Handler.handleCallback(Handler.java:725)
01-29 11:35:30.955: E/AndroidRuntime(16214): at android.os.Handler.dispatchMessage(Handler.java:92)
01-29 11:35:30.955: E/AndroidRuntime(16214): at android.os.Looper.loop(Looper.java:176)
01-29 11:35:30.955: E/AndroidRuntime(16214): at android.app.ActivityThread.main(ActivityThread.java:5279)
01-29 11:35:30.955: E/AndroidRuntime(16214): at java.lang.reflect.Method.invokeNative(Native Method)
01-29 11:35:30.955: E/AndroidRuntime(16214): at java.lang.reflect.Method.invoke(Method.java:511)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
01-29 11:35:30.955: E/AndroidRuntime(16214): at dalvik.system.NativeStart.main(Native Method)
01-29 11:35:30.955: E/AndroidRuntime(16214): Caused by: java.lang.ExceptionInInitializerError
01-29 11:35:30.955: E/AndroidRuntime(16214): at java.lang.Class.classForName(Native Method)
01-29 11:35:30.955: E/AndroidRuntime(16214): at java.lang.Class.forName(Class.java:217)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.googlecode.javacpp.Loader.load(Loader.java:453)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.googlecode.javacv.cpp.opencv_contrib.<clinit>(opencv_contrib.java:104)
01-29 11:35:30.955: E/AndroidRuntime(16214): ... 14 more
01-29 11:35:30.955: E/AndroidRuntime(16214): Caused by: java.lang.ExceptionInInitializerError
01-29 11:35:30.955: E/AndroidRuntime(16214): at java.lang.Class.classForName(Native Method)
01-29 11:35:30.955: E/AndroidRuntime(16214): at java.lang.Class.forName(Class.java:217)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.googlecode.javacpp.Loader.load(Loader.java:453)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.googlecode.javacv.cpp.opencv_calib3d.<clinit>(opencv_calib3d.java:94)
01-29 11:35:30.955: E/AndroidRuntime(16214): ... 18 more
01-29 11:35:30.955: E/AndroidRuntime(16214): Caused by: java.lang.ExceptionInInitializerError
01-29 11:35:30.955: E/AndroidRuntime(16214): at java.lang.Class.classForName(Native Method)
01-29 11:35:30.955: E/AndroidRuntime(16214): at java.lang.Class.forName(Class.java:217)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.googlecode.javacpp.Loader.load(Loader.java:453)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:85)
01-29 11:35:30.955: E/AndroidRuntime(16214): ... 22 more
01-29 11:35:30.955: E/AndroidRuntime(16214): Caused by: java.lang.ExceptionInInitializerError
01-29 11:35:30.955: E/AndroidRuntime(16214): at java.lang.Class.classForName(Native Method)
01-29 11:35:30.955: E/AndroidRuntime(16214): at java.lang.Class.forName(Class.java:217)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.googlecode.javacpp.Loader.load(Loader.java:453)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:97)
01-29 11:35:30.955: E/AndroidRuntime(16214): ... 26 more
01-29 11:35:30.955: E/AndroidRuntime(16214): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load jniopencv_core from loader dalvik.system.PathClassLoader[dexPath=/data/app/edu.cmu.pocketsphinx.demo-1.apk,libraryPath=/data/app-lib/edu.cmu.pocketsphinx.demo-1]: findLibrary returned null
01-29 11:35:30.955: E/AndroidRuntime(16214): at java.lang.Runtime.loadLibrary(Runtime.java:365)
01-29 11:35:30.955: E/AndroidRuntime(16214): at java.lang.System.loadLibrary(System.java:535)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.googlecode.javacpp.Loader.load(Loader.java:489)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.googlecode.javacpp.Loader.load(Loader.java:431)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:136)
01-29 11:35:30.955: E/AndroidRuntime(16214): ... 30 more
01-29 11:35:30.955: E/AndroidRuntime(16214): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load opencv_core from loader dalvik.system.PathClassLoader[dexPath=/data/app/edu.cmu.pocketsphinx.demo-1.apk,libraryPath=/data/app-lib/edu.cmu.pocketsphinx.demo-1]: findLibrary returned null
01-29 11:35:30.955: E/AndroidRuntime(16214): at java.lang.Runtime.loadLibrary(Runtime.java:365)
01-29 11:35:30.955: E/AndroidRuntime(16214): at java.lang.System.loadLibrary(System.java:535)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
01-29 11:35:30.955: E/AndroidRuntime(16214): at com.googlecode.javacpp.Loader.load(Loader.java:481)
01-29 11:35:30.955: E/AndroidRuntime(16214): ... 32 more
01-29 11:35:30.985: D/dalvikvm(16214): Rejecting registerization due to ushr-int/lit8 v4, v7, (#19)
01-29 11:35:30.995: D/dalvikvm(16214): Rejecting registerization due to ushr-int/lit8 v4, v7, (#19)
01-29 11:35:31.105: I/Process(16214): Sending signal. PID: 16214 SIG: 9

代码的一部分是
PersonRecognizer(String path)
{
faceRecognizer = com.googlecode.javacv.cpp.opencv_contrib.createLBPHFaceRecognizer(2,8,8,8,200);
// path=Environment.getExternalStorageDirectory()+"/facerecog/faces/";
mPath=path;
labelsFile= new labels(mPath);


}

最佳答案

我认为this可能有所帮助。而且您必须自己编译库,不要直接导入二进制文件。

编辑:

从评论中,我猜您正在使用使用Intel Atom的三星银河选项卡10.1,我再次猜想它是x86架构,而不是ARM,就像您在三星Galaxy S5中使用的那样。因此,您必须编译x86的源代码或将库的X86(二进制)文件夹导入到项目的libs文件夹中。

PS:从所有平台here的源代码编译NDK的教程

编辑:
有关平板电脑的更多信息here

关于android - 查找库在迁移到平板电脑时返回null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28207766/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com