我的项目引用webrtcpeer-android作为库,当它在设备(android 4.4.4 api 17)上运行时,崩溃,错误:


  08-26 11:53:38.959 6712-6712 / fi.vtt.nubotest W / System.err:
      java.lang.NoClassDefFoundError:org / webrtc / MediaCodecVideoDecoder $ DecoderOutputBufferInfo
  08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:at java.lang.Runtime.nativeLoad(Native Method)08-26 11:53:38.969 6712-6712 / fi.vtt .nu​​botest W / System.err:在java.lang.Runtime.doLoad(Runtime.java:421)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:在java.lang .Runtime.loadLibrary(Runtime.java:362)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:位于java.lang.System.loadLibrary(System.java:526)08 -26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:at org.webrtc.Logging。(Logging.java:27)08-26 11:53:38.969 6712-6712 / fi。 vtt.nubotest W / System.err:在org.webrtc.VideoRendererGui.setView(VideoRendererGui.java:416)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:在fi。 vtt.nubotest.PeerVideoActivity.onCreate(PeerVideoActivity.java:177)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:位于android.app.Activity.performCreate(Activity.java: 5303)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1091)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:位于android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2165)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2255)08-26 11:53:38.969 6712- 6712 / fi.vtt.nubotest W / System.err:at android.app.ActivityThread.access $ 800(ActivityThread.java:142)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System。错误:在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1213)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:在android.os.Handler.dispatchMessage (Handler.java:102)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:at android.os.Looper.loop(Looper.java:136)08-26 11: 53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:位于android.app.ActivityThread.main(ActivityThread.java:5217)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:在java.lang.reflect.Method.invokeNative(本机方法)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:在Java .lang.reflect.Method.invoke(Method.java:515)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller .run(ZygoteInit.java:818)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634 )08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:at dalvik.system.NativeStart.main(Native Method)08-26 11:53:38.969 6712-6712 / fi。 vtt.nubotest W / System.err:由以下原因引起:java.lang.ClassNotFoundException:在路径:DexPathList [[zip file“ /data/app/fi.vtt。]中找不到类” org.webrtc.MediaCodecVideoDecoder $ DecoderOutputBufferInfo“。 nubotest-2.apk“],nativeLibraryDirectories = [/ data / app-lib / fi.vtt.nubotest-2,/ vendor / lib,/ system / lib]] 08-26 11:53:38.969 6712-6712 / fi .vtt.nubotest W / System.err:在dalvik.sys tem.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:位于java.lang.ClassLoader.loadClass(ClassLoader.java:497) 08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:at java.lang.ClassLoader.loadClass(ClassLoader.java:457)08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest W / System.err:... 21更多08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest E / rtc:#
                                                          #../../talk/app/webrtc/java/jni/classreferenceholder.cc中的致命错误,第136行
                                                          #检查失败:!jni-> ExceptionCheck()
                                                          #在FindClass期间出错:org / webrtc / MediaCodecVideoDecoder $ DecoderOutputBufferInfo
                                                          #08-26 11:53:38.969 6712-6712 / fi.vtt.nubotest A / libc:致命信号6(SIGABRT)位于0x00001a38(code = -6),线程6712(fi.vtt.nubotest)


但是当我将webtrcpeer-android 用作罐子时,它可以正常工作,有人可以帮助我,谢谢!

Android ClassNotFoundException: Didn't find class on path

Android ClassNotFoundException: Didn't find class on path

我已经尝试了上述所有方法,但是没有用。

最佳答案

在您的proguard-rules.pro中添加以下行

-keep org.webrtc。** {*; }

关于java - Android java.lang.ClassNotFoundException(webrtc),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39160258/

10-15 21:04