Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

pjsip

I am implementing a android project for different processors. Every thing fine when I use only one so file libs/armeabi/libpjsua2.so

But I use multiple so files like libs/armeabi-v7a/libpjsua2.so, libs/mips/libpjsua2.so, libs/x86/libpjsua2.so, App getting 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)
like image 239
Gangadhar Nimballi Avatar asked Oct 20 '22 07:10

Gangadhar Nimballi


1 Answers

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

-keep class org.pjsip.pjsua2** {*;}
like image 189
Muhammed Tanriverdi Avatar answered Nov 02 '22 07:11

Muhammed Tanriverdi