0

run AllJoyn.apk faild

asked 2014-08-03 03:08:16 -0800

this post is marked as community wiki

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.182: W/dalvikvm(798): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
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.LoadedApk.makeApplication(LoadedApk.java:499)
08-03 08:56:04.242: E/AndroidRuntime(798):  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4364)
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 android.app.ActivityThread.main(ActivityThread.java:5041)
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): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load daemon-jni from loader dalvik.system.PathClassLoader[dexPath=/data/app/org.alljoyn.bus.alljoyn-1.apk,libraryPath=/data/app-lib/org.alljoyn.bus.alljoyn-1]: findLibrary returned null
08-03 08:56:04.242: E/AndroidRuntime(798):  at java.lang.Runtime.loadLibrary(Runtime.java:365)
08-03 08:56:04.242: E/AndroidRuntime(798):  at java.lang.System.loadLibrary(System.java:535)
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 ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-08-04 11:33:07 -0800

bspencer gravatar image

updated 2014-08-04 11:35:39 -0800

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.

edit flag offensive delete publish link more

Comments

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.

0502lian ( 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.

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

Thanks in advance!

0502lian ( 2014-08-12 05:07:40 -0800 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2014-08-03 03:08:16 -0800

Seen: 122 times

Last updated: Aug 04 '14