'Renaming pjsua2 android sample app package name stopped loading Library?

I was able to get Android pjsip pjsua2 working ,but when ever package name has been renamed from original package name ,library stop loading with below errors.

Any help would be highly appreciated.

2022-05-19 14:18:57.074 26653-26653/com.pjsip.pjsua2.app I/System.out: Library loaded
2022-05-19 14:18:57.120 26653-26653/com.pjsip.pjsua2.app E/jsip.pjsua2.ap: No implementation found for void com.pjsip.pjsua2.pjsua2JNI.swig_module_init() (tried Java_com_pjsip_pjsua2_pjsua2JNI_swig_1module_1init and Java_com_pjsip_pjsua2_pjsua2JNI_swig_1module_1init__)
2022-05-19 14:18:57.121 26653-26653/com.pjsip.pjsua2.app D/AndroidRuntime: Shutting down VM
2022-05-19 14:18:57.125 26653-26653/com.pjsip.pjsua2.app E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.pjsip.pjsua2.app, PID: 26653
    java.lang.UnsatisfiedLinkError: No implementation found for void com.pjsip.pjsua2.pjsua2JNI.swig_module_init() (tried Java_com_pjsip_pjsua2_pjsua2JNI_swig_1module_1init and Java_com_pjsip_pjsua2_pjsua2JNI_swig_1module_1init__)
        at com.pjsip.pjsua2.pjsua2JNI.swig_module_init(Native Method)
        at com.pjsip.pjsua2.pjsua2JNI.<clinit>(pjsua2JNI.java:2740)
        at com.pjsip.pjsua2.pjsua2JNI.new_Endpoint(Native Method)
        at com.pjsip.pjsua2.Endpoint.<init>(Endpoint.java:69)
        at com.pjsip.pjsua2.app.MyApp.<clinit>(MyApp.java:287)
        at com.pjsip.pjsua2.app.MainActivity2.onCreate(MainActivity2.java:211)
        at android.app.Activity.performCreate(Activity.java:8207)
        at android.app.Activity.performCreate(Activity.java:8191)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3808)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4011)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2325)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:246)
        at android.app.ActivityThread.main(ActivityThread.java:8633)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)


Solution 1:[1]

It depends on the precise implementation of “asking user for input”. If this is readline, which implements shell-like input with the prompt and editing, it won’t work. The reason is that the library messes up with the terminal configuration. If two processes are doing the same thing simultaneously they will step on each other’s foot.

If we are talking about simply reading from standard input, that will work, but with a few quirks. First, without external synchronization it’s not known in which order processes are going to consume the input. It is even possible that process A grabs a few chunks from the input line, while process B grabs the rest.

Second, standard streams are buffered, therefore a process might consume more input than immediately obvious. E.g. the program reads a single line of input, but internally more data is read from the OS, since there’s no way to ask for bytes until the new line. The other process reading input simultaneously won’t get the input the other process consumed, even if the later only done it due to buffering and didn’t use the input.

To conclude, probably better to avoid having multiple processes consume input simultaneously.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nick Zavaritsky