我需要在一个 android 应用程序中实现 ONVIF,直到现在我还没有取得太大的成功。我尝试使用evercam,但使用它会导致“ClassNotFoundException”。这是完整的堆栈跟踪。
04-22 20:20:22.182 5327-5638/com.example.cooln.onvif_tester E/AndroidRuntime: FATAL EXCEPTION: pool-1-thread-2
Process: com.example.cooln.onvif_tester, PID: 5327
java.lang.NoClassDefFoundError: Failed resolution of: Lnet/sbbi/upnp/Discovery;
at io.evercam.network.discovery.UpnpDiscovery.discoverAll(UpnpDiscovery.java:34)
at io.evercam.network.UpnpRunnable.run(UpnpRunnable.java:25)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "net.sbbi.upnp.Discovery" on path: DexPathList[[zip file "/data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/base.apk", zip file "/data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_resources_apk.apk", zip file "/data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/lib/arm64, /data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/base.apk!/lib/arm64-v8a, /data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_dependencies_apk.apk!/lib/arm64-v8a, /data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_resources_apk.apk!/lib/arm64-v8a, /data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_0_apk.apk!/lib/arm64-v8a, /data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_1_apk.apk!/lib/arm64-v8a, /data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_2_apk.apk!/lib/arm64-v8a, /data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_3_apk.apk!/lib/arm64-v8a, /data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_4_apk.apk!/lib/arm64-v8a, /data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_5_apk.apk!/lib/arm64-v8a, /data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_6_apk.apk!/lib/arm64-v8a, /data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_7_apk.apk!/lib/arm64-v8a, /data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_8_apk.apk!/lib/arm64-v8a, /data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_slice_9_apk.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at io.evercam.network.discovery.UpnpDiscovery.discoverAll(UpnpDiscovery.java:34)
at io.evercam.network.UpnpRunnable.run(UpnpRunnable.java:25)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.example.cooln.onvif_tester-QGIXBRlgj6RGsdcqR4YWug==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:353)
04-22 20:20:22.184 5327-5638/com.example.cooln.onvif_tester E/AndroidRuntime: at dalvik.system.DexFile.<init>(DexFile.java:100)
at dalvik.system.DexFile.<init>(DexFile.java:74)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)
at dalvik.system.DexPathList.<init>(DexPathList.java:157)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:69)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:36)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:669)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:702)
at android.app.LoadedApk.getResources(LoadedApk.java:929)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2242)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5708)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:172)
at android.app.ActivityThread.main(ActivityThread.java:6637)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
有没有人有任何想法如何以不同的方式实现它?