Get Started         Best Practices         Developer Guide         FAQ        
Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Android example working with RubyMotion

Paul Sturgess Jul 16, 2015

Hi, has anyone got the Android example working with RubyMotion.

I'm getting:

W/dalvikvm(12414): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/craftar/CraftARActivity;
W/dalvikvm(12414): JNI WARNING: JNI function IsInstanceOf called with exception pending
W/dalvikvm(12414): in Ljava/lang/Runtime;.nativeLoad:(Ljava/lang/String;Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/String; (IsInstanceOf)
W/dalvikvm(12414): Pending exception is:
I/dalvikvm(12414): java.lang.UnsatisfiedLinkError: Couldn't load track from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.yourcompany.craftarandroid-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.yourcompany.craftarandroid-1, /vendor/lib, /system/lib]]]: findLibrary returned null
...


( Agent )
Miquel Ferrarons

Jul 16, 2015

Hi Paul,

The error shows that one of the binaries could not be loaded. There’s a binary ‘libtrack.so’ that should be included somewhere in your project, for the armv-7a architecture. Can you confirm that it’s there?

0 rated
( Agent )
Miquel Ferrarons

Jul 16, 2015

Well, you can also try to unpack the .apk and see if the library is there.

Just de-compress the .apk as if it was a zip, and look under the lib/armeabi-v7a/ folder and check that the libtrack.so file is there.

0 rated
Paul Sturgess

Jul 17, 2015

Thanks Miquel.

I found out how to include the .so files, in my Rakefile I did this:


app.vendor_project jar: 'vendor/craftar-augmented-reality-sdk-android/libs/android-support-v4.jar',
native: [
"src/main/jniLibs/armeabi-v7a/libCraftARSDK_neon.so",
"src/main/jniLibs/armeabi-v7a/libCraftARSDK.so",
"src/main/jniLibs/armeabi-v7a/libneondetection.so",
"src/main/jniLibs/armeabi-v7a/libtrack.so"
]
app.vendor_project jar: 'vendor/craftar-augmented-reality-sdk-android/libs/android-tracking-sdk.jar'
app.vendor_project jar: "vendor/craftar-augmented-reality-sdk-android/libs/ofandroidlib.jar"
app.vendor_project jar: "vendor/craftar-augmented-reality-sdk-android/libs/sanselan-0.97-incubator.jar"



So now when I unpack the .apk file I can see lib/armeabi contains:
libpayload.so
libCraftARSDK_neon.so
libneondetection.so
libCraftARSDK.so
libtrack.so
gdbserver


However, the new error I get is:

java.lang.UnsatisfiedLinkError: Native method not found: com.yourcompany.craftarandroid.ARProgrammaticallyActivity.onPostCreate:(Landroid/os/Bundle;)V
0 rated
( Agent )
Miquel Ferrarons

Jul 17, 2015

The error shows that the method onPostCreate(Bundle savedInstance) could not be found in the class ARProgramaticallyActivity from the package com.yourcompany.craftarandroid

The method onPostCreate(Bundle savedInstanceState) it’s a method from Android Activity http://developer.android.com/reference/android/app/Activity.html#onPostCreate(android.os.Bundle). Note that this is not the method onPostCreate() from the CraftARActivity, since the one from the CraftARActivity has no parameters.

So, can you confirm that your class ARProgramatically activity is in the package com.yourcompany.craftarandroid? It looks like it might not be in that package, or that your removed the class and you’re still referencing it.

If you send us the .apk that it’s being generated, we will check what could be happening. Please send it privately to support@catchoom.com.

Thanks,

Miquel.

0 rated
Paul Sturgess

Jul 17, 2015

Thanks Miquel,

My ARProgrammaticallyActivity class is the one I'm trying to use and it extends (inherits in ruby language) from CraftARActivity.

I've implemented the onPostCreate(bundle) method in my ARProgrammaticallyActivity class and it resolved that error.

However, my onPostCreate method (with no arguments) is not called.

Thanks for your help.



0 rated
( Agent )
Miquel Ferrarons

Jul 20, 2015

So, did you manage to run the app? Can you send us the logs or the .apk, so we can see what’s happening? The onPostCreate method should be called right after onCreate finishes.

0 rated

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)

Couldn't find what you were looking for?

support@catchoom.com
https://cdn.desk.com/
false
catchoom
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete