Android java.lang.ClassNotFoundException (webrtc)

0

My project reference webrtcpeer-android as a library ,when it run on the device (android 4.4.4 api 17) ,it crash, error:

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.nubotest W/System.err: at java.lang.Runtime.doLoad(Runtime.java:421) 08-26 11:53:38.969 6712-6712/fi.vtt.nubotest W/System.err: at java.lang.Runtime.loadLibrary(Runtime.java:362) 08-26 11:53:38.969 6712-6712/fi.vtt.nubotest W/System.err: at 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: at org.webrtc.VideoRendererGui.setView(VideoRendererGui.java:416) 08-26 11:53:38.969 6712-6712/fi.vtt.nubotest W/System.err: at fi.vtt.nubotest.PeerVideoActivity.onCreate(PeerVideoActivity.java:177) 08-26 11:53:38.969 6712-6712/fi.vtt.nubotest W/System.err: at 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: at 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.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1213) 08-26 11:53:38.969 6712-6712/fi.vtt.nubotest W/System.err: at 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: at android.app.ActivityThread.main(ActivityThread.java:5217) 08-26 11:53:38.969 6712-6712/fi.vtt.nubotest W/System.err: at java.lang.reflect.Method.invokeNative(Native Method) 08-26 11:53:38.969 6712-6712/fi.vtt.nubotest W/System.err: at 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: Caused by: java.lang.ClassNotFoundException: Didn't find class "org.webrtc.MediaCodecVideoDecoder$DecoderOutputBufferInfo" on path: DexPathList[[zip file "/data/app/fi.vtt.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: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 08-26 11:53:38.969 6712-6712/fi.vtt.nubotest W/System.err: at 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 more 08-26 11:53:38.969 6712-6712/fi.vtt.nubotest E/rtc: # # Fatal error in ../../talk/app/webrtc/java/jni/classreferenceholder.cc, line 136 # Check failed: !jni->ExceptionCheck() # error during FindClass: org/webrtc/MediaCodecVideoDecoder$DecoderOutputBufferInfo # 08-26 11:53:38.969 6712-6712/fi.vtt.nubotest A/libc: Fatal signal 6 (SIGABRT) at 0x00001a38 (code=-6), thread 6712 (fi.vtt.nubotest)

but when I use webtrcpeer-android as a jar,it works normal,somebody who can help me,thanks!

Android ClassNotFoundException: Didn't find class on path

Android ClassNotFoundException: Didn't find class on path

I had try all the above method ,but it not work.

java
android
classnotfoundexception
asked on Stack Overflow Aug 26, 2016 by SR71K • edited May 23, 2017 by Community

1 Answer

2

Add following line in your proguard-rules.pro

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

answered on Stack Overflow Mar 8, 2019 by Sachin Jagtap

User contributions licensed under CC BY-SA 3.0