# run AllJoyn.apk faild

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi, guys! I just want to run AllJoyn Daemon on My phone. I have builded Alljoyn.apk from alljoyn-14.02.00 source code. But when it runs on my phone or android emulator, It shows "Unfortunately, AllJoyn has stopped". The detail information is:

08-03 08:56:04.127: W/dalvikvm(798): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/alljoyn/bus/alljoyn/AllJoynApp;
08-03 08:56:04.182: W/dalvikvm(798): Class init failed in newInstance call (Lorg/alljoyn/bus/alljoyn/AllJoynApp;)
08-03 08:56:04.182: D/AndroidRuntime(798): Shutting down VM
08-03 08:56:04.242: E/AndroidRuntime(798): FATAL EXCEPTION: main
08-03 08:56:04.242: E/AndroidRuntime(798): java.lang.ExceptionInInitializerError
08-03 08:56:04.242: E/AndroidRuntime(798):  at java.lang.Class.newInstanceImpl(Native Method)
08-03 08:56:04.242: E/AndroidRuntime(798):  at java.lang.Class.newInstance(Class.java:1319)
08-03 08:56:04.242: E/AndroidRuntime(798):  at android.app.Instrumentation.newApplication(Instrumentation.java:983)
08-03 08:56:04.242: E/AndroidRuntime(798):  at android.app.Instrumentation.newApplication(Instrumentation.java:968)
08-03 08:56:04.242: E/AndroidRuntime(798):  at android.app.ActivityThread.access$1300(ActivityThread.java:141) 08-03 08:56:04.242: E/AndroidRuntime(798): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
08-03 08:56:04.242: E/AndroidRuntime(798):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-03 08:56:04.242: E/AndroidRuntime(798):  at android.os.Looper.loop(Looper.java:137)
08-03 08:56:04.242: E/AndroidRuntime(798):  at java.lang.reflect.Method.invokeNative(Native Method)
08-03 08:56:04.242: E/AndroidRuntime(798):  at java.lang.reflect.Method.invoke(Method.java:511)
08-03 08:56:04.242: E/AndroidRuntime(798):  at com.android.internal.os.ZygoteInit\$MethodAndArgsCaller.run(ZygoteInit.java:793)
08-03 08:56:04.242: E/AndroidRuntime(798):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
08-03 08:56:04.242: E/AndroidRuntime(798):  at dalvik.system.NativeStart.main(Native Method)
08-03 08:56:04.242: E/AndroidRuntime(798):  at org.alljoyn.bus.alljoyn.AllJoynApp.<clinit>(AllJoynApp.java:208)
08-03 08:56:04.242: E/AndroidRuntime(798):  ... 16 more

I am a layman to android ...

edit retag close merge delete

Sort by » oldest newest most voted

The AllJoyn.apk is no longer needed. You do not need to have this installed to use AllJoyn in an application. Any Android application that uses the AllJoyn SDK will automatically include a version of the AllJoyn Router that it will startup inside the application process. You can ignore this and move straight to writing/running the AllJoyn sample applications. Also be sure that you use the samples for the language you want, IE if you wish to write an Android application in Dalvik use the java/samples folder in the SDK. For NDK development use cpp/samples.

To be thorough, if you do want to play around using the AllJoyn.apk project you will need to use the NDK to compile the C++ software that the project needs to load. The AllJoyn.apk project is an NDK project and the

find library returned null

message is due to not finding the .so file needed to be loaded for the application to run. You will need to use ndk-build to compile the jni code and then it will run.

more

Hi Bspencer. Thank you very much for your help. I know that The Alljoyn Daemon is no longer needed by the AJSC applications. I am working on the AJTC applications. it needs a Alljoyn Daemon running on a PC or a phone, so that it can connect to any AJTC or AJSC applications. Is That right? Thanks again for your kindness.

( 2014-08-09 20:16:16 -0800 )edit

Yes it is true that a AJ Thin Core Library application needs an AllJoyn Router. However, the AllJoyn Router software is part of any AllJoyn application on a mobile device. A mobile device starts up a bundled instance that you can expose to allow other AJTC applications to use. See the Notification sample: https://git.allseenalliance.org/cgit/services/base.git/tree/notification/java/sample_applications/android/NotificationServiceUISample/src/org/alljoyn/ns/sampleapp/IoeNotificationApplication.java Follow line 67: DAEMON_NAME_PREFIX and see it advertising the "org.alljoyn.BusNode" prefix to allow AJTC devices to connect.

( 2014-08-11 11:54:17 -0800 )edit