-1

i am creating a chat application by using Alljoyn framework and am getting the following error can somebody please help me. The alljoyn jars are already set up!!!

FATAL EXCEPTION: main
                                                                               Process: com.example.vikesh.chat_application, PID: 4326
                                                                               java.lang.UnsatisfiedLinkError: Couldn't load alljoyn_java from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.vikesh.chat_application-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.vikesh.chat_application-1, /vendor/lib, /system/lib]]]: findLibrary returned null
                                                                                   at java.lang.Runtime.loadLibrary(Runtime.java:358)
                                                                                   at java.lang.System.loadLibrary(System.java:526)
                                                                                   at com.example.vikesh.chat_application.AlljoynService.<clinit>(AlljoynService.java:1252)
                                                                                   at java.lang.Class.newInstanceImpl(Native Method)
                                                                                   at java.lang.Class.newInstance(Class.java:1208)
                                                                                   at android.app.ActivityThread.handleCreateService(ActivityThread.java:2553)
                                                                                   at android.app.ActivityThread.access$1800(ActivityThread.java:135)
                                                                                   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
                                                                                   at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                   at android.os.Looper.loop(Looper.java:136)
                                                                                   at android.app.ActivityThread.main(ActivityThread.java:5017)
                                                                                   at java.lang.reflect.Method.invokeNative(Native Method)
                                                                                   at java.lang.reflect.Method.invoke(Method.java:515)
                                                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
                                                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
                                                                                   at dalvik.system.NativeStart.main(Native Method)
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245

1 Answers1

1

You need to put the AllJoyn liballjoyn_java.so file within your project. For example, in Android Studio, the usual location for this file is: [your_project_dir]/app/src/main/jniLibs/armeabi/

The armeabi portion of the above path is assuming that the AllJoyn .so file that you have previously built is targeted for the 'arm' CPU (the armeabi instruction set).

Note: When I deleted the .so file from my app, I got the same error that you are reporting. When I put the .so file back I still got the same error. I had to uninstall the app from my Android device, and in Android Studio I had to clean and rebuild the app, before I was able to get past this error.

Some other things to consider...

Make sure in your App that you are calling

static {
    System.loadLibrary("alljoyn_java");
}

Make sure that the liballjoyn_java.so you previously built matches the cpu instruction set of your Android device. You can verify your Android's instruction set by using an app such as Droid Info, for example. Assuming that it is armeabi, then when you build the AllJoyn core project, you need to specify at a minimum the following switches in your scons build command....

scons BINDINGS="cpp,java,c" OS=android CPU=arm VARIANT=release

Finally, the following Stackoverflow link discusses general reasons the error you are seeing can occur: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader

Community
  • 1
  • 1
P. Sigurdson
  • 151
  • 4
  • This is the current location of the Alljoyn libllijoyn_java.so , it is actually already within the project file in "C:\Users\vikesh\Desktop\Final Year Project\Source_Code\Chat_Application\app\src\main\jniLibs\armeabi" – Vikesh Sohotoo Dec 12 '16 at 05:36
  • Thanks a lot for the answer Sir – Vikesh Sohotoo Dec 14 '16 at 05:45
  • @ P. Sigurdson :hello sir,here i used jingle_peerconnection_so.so file in my project and i got same error and i make all folder in jnilib but still issue in samsung galaxy tab 7"(SM-T311) .so please suggest me what is the problem ? – Sachin Suthar Jul 14 '17 at 09:39