0

can't build basicclient for android on exlipse/ubuntu

asked 2014-07-15 15:32:29 -0700

kamyar gravatar image

updated 2014-07-15 15:39:20 -0700

I have been trying for a couple of days and i can't find a way to generate basicClient for android. i tried android studio but failed due to lack of tutorials.

can someone please help me? this is the logcat from when i try to run it from eclipse on my physical device.

what is wrong with this state of project? Please let me know if you need any info about the project structure and content of files.

thanks in advance

07-16 01:07:29.469: D/dalvikvm(22389): DexOpt: couldn't find field Landroid/app/ActivityThread;.mActiveResources
07-16 01:07:29.469: W/dalvikvm(22389): VFY: unable to resolve instance field 1
07-16 01:07:29.469: D/dalvikvm(22389): VFY: replacing opcode 0x54 at 0x0006
07-16 01:07:29.469: D/dalvikvm(22389): DexOpt: couldn't find field Landroid/app/ActivityThread;.mPackages
07-16 01:07:29.469: W/dalvikvm(22389): VFY: unable to resolve instance field 4
07-16 01:07:29.469: D/dalvikvm(22389): VFY: replacing opcode 0x54 at 0x0000
07-16 01:07:29.479: W/dalvikvm(22389): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/alljoyn/bus/samples/simpleclient/Client;
07-16 01:07:29.479: W/dalvikvm(22389): Class init failed in newInstance call (Lorg/alljoyn/bus/samples/simpleclient/Client;)
07-16 01:07:29.479: D/AndroidRuntime(22389): Shutting down VM
07-16 01:07:29.479: W/dalvikvm(22389): threadid=1: thread exiting with uncaught exception (group=0x4152bba8)
07-16 01:07:29.489: E/AndroidRuntime(22389): FATAL EXCEPTION: main
07-16 01:07:29.489: E/AndroidRuntime(22389): Process: org.alljoyn.bus.samples.simpleclient, PID: 22389
07-16 01:07:29.489: E/AndroidRuntime(22389): java.lang.UnsatisfiedLinkError: Couldn't load SimpleClient from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.alljoyn.bus.samples.simpleclient-2.apk"],nativeLibraryDirectories=[/data/app-lib/org.alljoyn.bus.samples.simpleclient-2, /vendor/lib, /system/lib]]]: findLibrary returned null
07-16 01:07:29.489: E/AndroidRuntime(22389):    at java.lang.Runtime.loadLibrary(Runtime.java:358)
07-16 01:07:29.489: E/AndroidRuntime(22389):    at java.lang.System.loadLibrary(System.java:526)
07-16 01:07:29.489: E/AndroidRuntime(22389):    at org.alljoyn.bus.samples.simpleclient.Client.<clinit>(Client.java:230)
07-16 01:07:29.489: E/AndroidRuntime(22389):    at java.lang.Class.newInstanceImpl(Native Method)
07-16 01:07:29.489: E/AndroidRuntime(22389):    at java.lang.Class.newInstance(Class.java:1208)
07-16 01:07:29.489: E/AndroidRuntime(22389):    at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
07-16 01:07:29.489: E/AndroidRuntime(22389):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
07-16 01:07:29.489: E/AndroidRuntime(22389):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
07-16 01:07:29.489: E/AndroidRuntime(22389):    at android.app.ActivityThread.access$800(ActivityThread.java:135)
07-16 01:07:29.489: E/AndroidRuntime(22389):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
07-16 01:07:29.489: E/AndroidRuntime(22389):    at android.os.Handler.dispatchMessage(Handler.java:102)
07-16 01:07:29 ...
(more)
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2014-07-18 14:23:51 -0700

Nikhil Dabhade gravatar image

updated 2014-07-18 14:37:47 -0700

Hi kamyar,

In case you just want to run the sample a prebuilt apk file is also available in the bin folder of each sample. If you want to play around with the code then the place to look for pure Java Android samples would be java/samples in the SDK. You might have looked at cpp/samples which has the C++ JNI samples that are present to showcase that writing C++ code can be used in and Android app using JNI. If you weren't interested in that we strongly recommend you should use the pure Java samples which are simpler to understand and write.

Also we haven't officially tested building the apps using Android Studio so your best bet right now would be to use ADT package provided on the Android developer website.

Please let me know if you still have problems proceeding.

Regards, Nikhil

edit flag offensive delete publish link more

Comments

i was able to build and test the chat app successfully. in case anyone faces this problem in the future, i forgot to add liballjoyn_java.so to <eclipse project="">/libs/armeabi/ and alljoyn.jar to <eclipse project="">/libs/. thanks nikhil. i am just new to alljoyn and android so i don't know such simple things but your comments allover the alljoyn forums are most helful ones. :) somehow out of topic but how may i use About feature, is there a tutorial to build/install it for use in android and linux? thanks in advance

kamyar ( 2014-07-23 15:20:28 -0700 )edit
0

answered 2014-07-16 11:28:58 -0700

bspencer gravatar image

The Simple Client project you have loaded is from the C++ part of the SDK which for Android is an NDK example. You will need to compile the JNI code if you wish to use that project instance using the ndk-build command from the Android NDK.

The other option you have is to use the Dalvik Android example found under the alljoyn-0.0.1416-rel/java/samples/simple folder in the SDK.

edit flag offensive delete publish link more

Comments

is there any resource on building jni code? i am not much familiar with them. thanks for your comment and time. :)

kamyar ( 2014-07-23 15:23:14 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2014-07-15 15:32:29 -0700

Seen: 341 times

Last updated: Jul 18 '14