Java.lang.NoSuchMethodError: no static method "Lorg / pjsip / pjsua2 / pjsua2JNI; .SwigDirector_AudioMediaPlayer in android

I am implementing an Android project for different processors. Everything is fine when I only use one libs / armeabi / libpjsua2.so file

But I am using several such files like libs / armeabi-v7a / libpjsua2.so, libs / mips / libpjsua2.so, libs / x86 / libpjsua2.so , the application gets crashed

Here is my logcat

07-07 15:57:59.016: W/System.err(21743): java.lang.NoSuchMethodError: no static method "Lorg/pjsip/pjsua2/pjsua2JNI;.SwigDirector_AudioMediaPlayer_onEof(Lorg/pjsip/pjsua2/AudioMediaPlayer;)Z"
07-07 15:57:59.017: W/System.err(21743):    at org.pjsip.pjsua2.pjsua2JNI.swig_module_init(Native Method)
07-07 15:57:59.017: W/System.err(21743):    at org.pjsip.pjsua2.pjsua2JNI.<clinit>(pjsua2JNI.java:2264)
07-07 15:57:59.017: W/System.err(21743):    at org.pjsip.pjsua2.Endpoint.<init>(Endpoint.java:68)
07-07 15:57:59.017: W/System.err(21743):    at net.bbg.mta.api.MyApp.<clinit>(MyApp.java:399)
07-07 15:57:59.017: W/System.err(21743):    at net.bbg.mta.api.SipApi.<init>(SipApi.java:158)
07-07 15:57:59.017: W/System.err(21743):    at net.bbg.mta.service.UCService.onStartCommand(UCService.java:82)
07-07 15:57:59.017: W/System.err(21743):    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2894)
07-07 15:57:59.017: W/System.err(21743):    at android.app.ActivityThread.access$2100(ActivityThread.java:151)
07-07 15:57:59.017: W/System.err(21743):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1401)
07-07 15:57:59.017: W/System.err(21743):    at android.os.Handler.dispatchMessage(Handler.java:102)
07-07 15:57:59.017: W/System.err(21743):    at android.os.Looper.loop(Looper.java:135)
07-07 15:57:59.017: W/System.err(21743):    at android.app.ActivityThread.main(ActivityThread.java:5254)
07-07 15:57:59.017: W/System.err(21743):    at java.lang.reflect.Method.invoke(Native Method)
07-07 15:57:59.017: W/System.err(21743):    at java.lang.reflect.Method.invoke(Method.java:372)
07-07 15:57:59.017: W/System.err(21743):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
07-07 15:57:59.017: W/System.err(21743):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

      

+3


source to share


1 answer


If you are using proguard to obfuscate your code, you need to specify proguard rules in your proguard-rules.txt to store your classes, methods, etc.



-keep class org.pjsip.pjsua2** {*;}

      

+2


source







All Articles