AllJoyn.apk on emulator

19 posts / 0 new
Last post
AllJoyn.apk on emulator
fransguelinckx's picture
Offline
Joined
01/12/2012 - 08:49
Posted
Sun, 01/22/2012 - 19:38

I want to install AllJoyn.apk in the emulator, but I can't find the file anywhere (looked in evert alljoyn_android directory). I built the alljoyn source for android succesfully by running the "scons OS=android..." in the top alljoyn directory. Am I missing the file or did I do anything wrong?

Thx,

Frans

Re: Can't find AllJoyn.apk
fransguelinckx's picture
Offline
Joined
01/12/2012 - 08:49

I managed to build the AllJoyn.apk file, but when I try to run it on the emulator it crashes immediately. What am I doing wrong?

Thanks in advance,

Frans

Re: Can't find AllJoyn.apk
Nikhil Dabhade Moderator
Nikhil Dabhade's picture
Offline
Joined
01/27/2011 - 17:39

Hi Frans,

I am assuming you built AllJoyn for Gingerbread (2.3.x)

Is your emulator running Gingerbread or Froyo ? Can you post the logcat from the crash ?

Regards,
Nikhil 

Re: AllJoyn.apk on emulator
fransguelinckx's picture
Offline
Joined
01/12/2012 - 08:49

I'm pretty shure I built everything for Gingerbread 2.3. Always used java sun 6.

Could there be a reason that I can't find a prebuilt AllJoyn.apk? I'll post the errorlog in a couple of minutes, it's on my other laptop.

Frans

Re: AllJoyn.apk on emulator
fransguelinckx's picture
Offline
Joined
01/12/2012 - 08:49

01-24 14:33:19.085: W/dalvikvm(329): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/alljoyn/bus/alljoyn/AllJoynApp;
01-24 14:33:19.085: W/dalvikvm(329): Class init failed in newInstance call (Lorg/alljoyn/bus/alljoyn/AllJoynApp;)
01-24 14:33:19.085: D/AndroidRuntime(329): Shutting down VM
01-24 14:33:19.085: W/dalvikvm(329): threadid=1: thread exiting with uncaught exception (group=0x40015560)
01-24 14:33:19.124: E/AndroidRuntime(329): FATAL EXCEPTION: main
01-24 14:33:19.124: E/AndroidRuntime(329): java.lang.ExceptionInInitializerError
01-24 14:33:19.124: E/AndroidRuntime(329):     at java.lang.Class.newInstanceImpl(Native Method)
01-24 14:33:19.124: E/AndroidRuntime(329):     at java.lang.Class.newInstance(Class.java:1409)
01-24 14:33:19.124: E/AndroidRuntime(329):     at android.app.Instrumentation.newApplication(Instrumentation.java:957)
01-24 14:33:19.124: E/AndroidRuntime(329):     at android.app.Instrumentation.newApplication(Instrumentation.java:942)
01-24 14:33:19.124: E/AndroidRuntime(329):     at android.app.LoadedApk.makeApplication(LoadedApk.java:461)
01-24 14:33:19.124: E/AndroidRuntime(329):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3260)
01-24 14:33:19.124: E/AndroidRuntime(329):     at android.app.ActivityThread.access$2200(ActivityThread.java:117)
01-24 14:33:19.124: E/AndroidRuntime(329):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:969)
01-24 14:33:19.124: E/AndroidRuntime(329):     at android.os.Handler.dispatchMessage(Handler.java:99)
01-24 14:33:19.124: E/AndroidRuntime(329):     at android.os.Looper.loop(Looper.java:123)
01-24 14:33:19.124: E/AndroidRuntime(329):     at android.app.ActivityThread.main(ActivityThread.java:3683)
01-24 14:33:19.124: E/AndroidRuntime(329):     at java.lang.reflect.Method.invokeNative(Native Method)
01-24 14:33:19.124: E/AndroidRuntime(329):     at java.lang.reflect.Method.invoke(Method.java:507)
01-24 14:33:19.124: E/AndroidRuntime(329):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
01-24 14:33:19.124: E/AndroidRuntime(329):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
01-24 14:33:19.124: E/AndroidRuntime(329):     at dalvik.system.NativeStart.main(Native Method)
01-24 14:33:19.124: E/AndroidRuntime(329): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load daemon-jni: findLibrary returned null
01-24 14:33:19.124: E/AndroidRuntime(329):     at java.lang.Runtime.loadLibrary(Runtime.java:429)
01-24 14:33:19.124: E/AndroidRuntime(329):     at java.lang.System.loadLibrary(System.java:554)
01-24 14:33:19.124: E/AndroidRuntime(329):     at org.alljoyn.bus.alljoyn.AllJoynApp.<clinit>(AllJoynApp.java:213)
01-24 14:33:19.124: E/AndroidRuntime(329):     ... 16 more
01-24 14:33:21.763: I/Process(329): Sending signal. PID: 329 SIG: 9

Re: AllJoyn.apk on emulator
fransguelinckx's picture
Offline
Joined
01/12/2012 - 08:49

I just noticed Android 2.2 is in the build path in stead of 2.3. The problem is I can't replace it with 2.3. Could this be the problem?

Frans

Re: AllJoyn.apk on emulator
Nikhil Dabhade Moderator
Nikhil Dabhade's picture
Offline
Joined
01/27/2011 - 17:39

Hi Frans,

Apologies but I could not get which build path are you referring to ? Are you referring to the emulator having Android 2.2 or build path passed in scons ?

Nikhil 

Re: AllJoyn.apk on emulator
fransguelinckx's picture
Offline
Joined
01/12/2012 - 08:49

I am referring to the build path of the eclipse project of the alljoyn android application.

Frans

Re: AllJoyn.apk on emulator
fransguelinckx's picture
Offline
Joined
01/12/2012 - 08:49

I managed to change the buildpath of the alljoyn application for android to 2.3.3, but it still crashes on startup in de emulator (also running 2.3.3).

Crash log:

01-26 21:33:11.352: W/dalvikvm(331): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/alljoyn/bus/alljoyn/AllJoynApp;
01-26 21:33:11.352: W/dalvikvm(331): Class init failed in newInstance call (Lorg/alljoyn/bus/alljoyn/AllJoynApp;)
01-26 21:33:11.352: D/AndroidRuntime(331): Shutting down VM
01-26 21:33:11.352: W/dalvikvm(331): threadid=1: thread exiting with uncaught exception (group=0x40015560)
01-26 21:33:11.392: E/AndroidRuntime(331): FATAL EXCEPTION: main
01-26 21:33:11.392: E/AndroidRuntime(331): java.lang.ExceptionInInitializerError
01-26 21:33:11.392: E/AndroidRuntime(331):     at java.lang.Class.newInstanceImpl(Native Method)
01-26 21:33:11.392: E/AndroidRuntime(331):     at java.lang.Class.newInstance(Class.java:1409)
01-26 21:33:11.392: E/AndroidRuntime(331):     at android.app.Instrumentation.newApplication(Instrumentation.java:957)
01-26 21:33:11.392: E/AndroidRuntime(331):     at android.app.Instrumentation.newApplication(Instrumentation.java:942)
01-26 21:33:11.392: E/AndroidRuntime(331):     at android.app.LoadedApk.makeApplication(LoadedApk.java:461)
01-26 21:33:11.392: E/AndroidRuntime(331):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3260)
01-26 21:33:11.392: E/AndroidRuntime(331):     at android.app.ActivityThread.access$2200(ActivityThread.java:117)
01-26 21:33:11.392: E/AndroidRuntime(331):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:969)
01-26 21:33:11.392: E/AndroidRuntime(331):     at android.os.Handler.dispatchMessage(Handler.java:99)
01-26 21:33:11.392: E/AndroidRuntime(331):     at android.os.Looper.loop(Looper.java:123)
01-26 21:33:11.392: E/AndroidRuntime(331):     at android.app.ActivityThread.main(ActivityThread.java:3683)
01-26 21:33:11.392: E/AndroidRuntime(331):     at java.lang.reflect.Method.invokeNative(Native Method)
01-26 21:33:11.392: E/AndroidRuntime(331):     at java.lang.reflect.Method.invoke(Method.java:507)
01-26 21:33:11.392: E/AndroidRuntime(331):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
01-26 21:33:11.392: E/AndroidRuntime(331):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
01-26 21:33:11.392: E/AndroidRuntime(331):     at dalvik.system.NativeStart.main(Native Method)
01-26 21:33:11.392: E/AndroidRuntime(331): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load daemon-jni: findLibrary returned null
01-26 21:33:11.392: E/AndroidRuntime(331):     at java.lang.Runtime.loadLibrary(Runtime.java:429)
01-26 21:33:11.392: E/AndroidRuntime(331):     at java.lang.System.loadLibrary(System.java:554)
01-26 21:33:11.392: E/AndroidRuntime(331):     at org.alljoyn.bus.alljoyn.AllJoynApp.<clinit>(AllJoynApp.java:213)
01-26 21:33:11.392: E/AndroidRuntime(331):     ... 16 more

Re: AllJoyn.apk on emulator
fransguelinckx's picture
Offline
Joined
01/12/2012 - 08:49

I solved i myself already. Thanks anyway:-)

Re: AllJoyn.apk on emulator
narasubr's picture
Offline
Joined
11/24/2011 - 23:29

Hi Frans,


From the errors, I think that you have not included lindaemon-jni.so while building AllJoyn.apk.

Hence you are getting the error 

01-24 14:33:19.124: E/AndroidRuntime(329): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load daemon-jni: findLibrary returned null

and hence the crash.

Assuming that you have built Alljoyn for android using scons, you need to do the following:

  1. Go to alljoyn_core/alljoyn_android/alljoyn/jni
  2. Do a ndk-build in this directory.

If this step is successful, then you should see a file alljoyn_core/alljoyn_android/alljoyn/libs/armeabi/libdaemon-jni.so.

Then, using eclipse, load the AllJoyn application and build it. You should not see any crashes by this method.

Please let me know if this doesnt work out.

Narayanan

P.S:-  You can try the AllJoyn sdk insteads of building AllJoyn by yourself. The AllJoyn sdk comes up with AllJoyn.apk and you can find that in  alljoyn_android/alljoyn/bin directory

Re: AllJoyn.apk on emulator
fransguelinckx's picture
Offline
Joined
01/12/2012 - 08:49

I got it working just before you posted this comment. Thanks anyway!

Weird this was that the prebuilt AllJoyn.apk was not included in de alljoyn sdk. 

Re: AllJoyn.apk on emulator
Nikhil Dabhade Moderator
Nikhil Dabhade's picture
Offline
Joined
01/27/2011 - 17:39

Hi Frans,

The prebuilt daemon is included in the SDK and can be found under alljoyn-sdk-2-3-2-android\alljoyn_2_3_2_dbg\alljoyn_android\alljoyn\bin

Were you not able to find it ?

Regards,
Nikhil 

Re: AllJoyn.apk on emulator
srijith's picture
Offline
Joined
04/12/2012 - 10:29

hi frans,

  I am working on opencv android application and when trying to run the application i am encountering the same trace that u have posted. It would be of great help if you could just tell me the steps to solve this problem.. I am using android 2.3.3....

regards,

srijith

Re: AllJoyn.apk on emulator
Nikhil Dabhade Moderator
Nikhil Dabhade's picture
Offline
Joined
01/27/2011 - 17:39

Hi Srijith,

Did you get a chance to try the solution posted by Narayanan in one of the comments above work for you or are you still seeing problems with the daemon on the emulator ?

Let us know so that we can help you solve this issue.

Regards,
Nikhil 

Re: Can't find AllJoyn.apk
sunset's picture
Offline
Joined
05/10/2012 - 22:50

Hi Frans,

I met the same problem that I also miss the AllJoyn.apk file (found the alljoyn.jar file). Could you tell me how did you managed to build it finally?

Re: Can't find AllJoyn.apk
Nikhil Dabhade Moderator
Nikhil Dabhade's picture
Offline
Joined
01/27/2011 - 17:39

Hi Sunset,

Are you still having problems with this ?

Regards,
Nikhil 

Re: Can't find AllJoyn.apk
sunset's picture
Offline
Joined
05/10/2012 - 22:50

Hi Nikhil,

I have fixed it, thank you!

BR,

Sunset

Re: Can't find AllJoyn.apk
Nikhil Dabhade Moderator
Nikhil Dabhade's picture
Offline
Joined
01/27/2011 - 17:39

Hi sunset,

Great :)
Let us know if you have any other issues. 

Regards,
Nikhil