好的,我对这个问题失去了理智。我的项目曾经工作过一段时间,然后一位朋友给我发了他修改过的项目副本,一切都变成了地狱。现在,无论我是试图运行我的版本还是他的版本,都不起作用,我在两者上都收到同样的错误。
11-04 01:05:02.753: E/AndroidRuntime(7915): FATAL EXCEPTION: main
11-04 01:05:02.753: E/AndroidRuntime(7915): Process: org.opencv.samples.tutorial2, PID: 7915
11-04 01:05:02.753: E/AndroidRuntime(7915): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.opencv.samples.tutorial2/org.opencv.samples.tutorial2.Tutorial2Activity}: java.lang.ClassNotFoundException: Didn't find class "org.opencv.samples.tutorial2.Tutorial2Activity" on path: DexPathList[[zip file "/data/app/org.opencv.samples.tutorial2-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.opencv.samples.tutorial2-1, /vendor/lib, /system/lib]]
11-04 01:05:02.753: E/AndroidRuntime(7915): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2126)
11-04 01:05:02.753: E/AndroidRuntime(7915): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250)
11-04 01:05:02.753: E/AndroidRuntime(7915): at android.app.ActivityThread.access$800(ActivityThread.java:139)
11-04 01:05:02.753: E/AndroidRuntime(7915): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1200)
11-04 01:05:02.753: E/AndroidRuntime(7915): at android.os.Handler.dispatchMessage(Handler.java:102)
11-04 01:05:02.753: E/AndroidRuntime(7915): at android.os.Looper.loop(Looper.java:136)
11-04 01:05:02.753: E/AndroidRuntime(7915): at android.app.ActivityThread.main(ActivityThread.java:5105)
11-04 01:05:02.753: E/AndroidRuntime(7915): at java.lang.reflect.Method.invokeNative(Native Method)
11-04 01:05:02.753: E/AndroidRuntime(7915): at java.lang.reflect.Method.invoke(Method.java:515)
11-04 01:05:02.753: E/AndroidRuntime(7915): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
11-04 01:05:02.753: E/AndroidRuntime(7915): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
11-04 01:05:02.753: E/AndroidRuntime(7915): at dalvik.system.NativeStart.main(Native Method)
11-04 01:05:02.753: E/AndroidRuntime(7915): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.opencv.samples.tutorial2.Tutorial2Activity" on path: DexPathList[[zip file "/data/app/org.opencv.samples.tutorial2-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.opencv.samples.tutorial2-1, /vendor/lib, /system/lib]]
11-04 01:05:02.753: E/AndroidRuntime(7915): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
11-04 01:05:02.753: E/AndroidRuntime(7915): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
11-04 01:05:02.753: E/AndroidRuntime(7915): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
11-04 01:05:02.753: E/AndroidRuntime(7915): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
11-04 01:05:02.753: E/AndroidRuntime(7915): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2117)
11-04 01:05:02.753: E/AndroidRuntime(7915): ... 11 more
所以这是我的LogCat输出消息。正如您所看到的,该项目是opencv示例的修改版本,所以我想在代码中应该检查,因为我只修改了项目的JNI文件,因为这是NDK项目。
我不知道是否有关于该项目的任何代码是必要的,因为我认为这不是与代码相关的问题。
非常欢迎任何可能的解决方案!
答案 0 :(得分:0)
好的,坦率地说,我通过将位置文件夹从新目的地更改为旧目的地来解决问题。不知道为什么这会影响项目,但它现在有效。