gpt4 book ai didi

opencv4android 示例编译但不运行

转载 作者:太空宇宙 更新时间:2023-11-03 23:02:20 25 4
gpt4 key购买 nike

我正在按照此处找到的试用 opencv4android 的教程进行操作 提供了多个示例。获取OpenCV-2.4.3.2-android-sdk并在我的设备上安装管理器后,我在eclipse中导入示例文件,它们都编译成功。但是,我尝试的任何样本都会立即在我的设备上崩溃。例如,如果我运行“15 puzzle”示例,我会得到以下错误日志

"01-27 23:11:50.523: E/AndroidRuntime(21568): FATAL EXCEPTION: main
01-27 23:11:50.523: E/AndroidRuntime(21568): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.opencv.samples.puzzle15/org.opencv.samples.puzzle15.Puzzle15Activity}: java.lang.ClassNotFoundException: org.opencv.samples.puzzle15.Puzzle15Activity
01-27 23:11:50.523: E/AndroidRuntime(21568): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1973)
01-27 23:11:50.523: E/AndroidRuntime(21568): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2083)
01-27 23:11:50.523: E/AndroidRuntime(21568): at android.app.ActivityThread.access$600(ActivityThread.java:134)
01-27 23:11:50.523: E/AndroidRuntime(21568): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1233)
01-27 23:11:50.523: E/AndroidRuntime(21568): at android.os.Handler.dispatchMessage(Handler.java:99)
01-27 23:11:50.523: E/AndroidRuntime(21568): at android.os.Looper.loop(Looper.java:137)
01-27 23:11:50.523: E/AndroidRuntime(21568): at android.app.ActivityThread.main(ActivityThread.java:4722)
01-27 23:11:50.523: E/AndroidRuntime(21568): at java.lang.reflect.Method.invokeNative(Native Method)
01-27 23:11:50.523: E/AndroidRuntime(21568): at java.lang.reflect.Method.invoke(Method.java:511)
01-27 23:11:50.523: E/AndroidRuntime(21568): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
01-27 23:11:50.523: E/AndroidRuntime(21568): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
01-27 23:11:50.523: E/AndroidRuntime(21568): at dalvik.system.NativeStart.main(Native Method)
01-27 23:11:50.523: E/AndroidRuntime(21568): Caused by: java.lang.ClassNotFoundException: org.opencv.samples.puzzle15.Puzzle15Activity
01-27 23:11:50.523: E/AndroidRuntime(21568): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
01-27 23:11:50.523: E/AndroidRuntime(21568): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
01-27 23:11:50.523: E/AndroidRuntime(21568): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
01-27 23:11:50.523: E/AndroidRuntime(21568): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
01-27 23:11:50.523: E/AndroidRuntime(21568): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1964)
01-27 23:11:50.523: E/AndroidRuntime(21568): ... 11 more"

我不确定我做错了什么,因为这在我尝试的任何 opencv 样本中都是一致的。在此先感谢您的帮助

最佳答案

如果其他人遇到类似的问题,我的解决方案只是针对 java 6 而不是 java 7 进行编译。在我撰写本文时,针对 java 7 的编译不适用于 opencv4android。

关于opencv4android 示例编译但不运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14555904/

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