Log in or register to post comments

Samples Crash

June 22, 2012 - 11:49am #1

I cant get the samples to run on my device.I'm trying the image targets sample.I ran NDK build command and got a libs folder with

 subfolders.

Fired up eclipse > File > New Project > Android > From existing source.

Cleaned and refreshed and it doesnt show any errors.The QCAR_SDK_ROOT variable also exists.However,when I run the application on my connected device ,screen goes black for a sec and then a message pops up saying the process has stopped unexpectedly and it force closes.

 

My Device - Samsung Galaxy Royal

Error Log

 

 E/AndroidRuntime(2497): FATAL EXCEPTION: main
 E/AndroidRuntime(2497): java.lang.ExceptionInInitializerError
 E/AndroidRuntime(2497):     at java.lang.Class.newInstanceImpl(Native Method)
 E/AndroidRuntime(2497):     at java.lang.Class.newInstance(Class.java:1409)
 E/AndroidRuntime(2497):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
 E/AndroidRuntime(2497):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
 E/AndroidRuntime(2497):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
 E/AndroidRuntime(2497):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
 E/AndroidRuntime(2497):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
 E/AndroidRuntime(2497):     at android.os.Handler.dispatchMessage(Handler.java:99)
 E/AndroidRuntime(2497):     at android.os.Looper.loop(Looper.java:130)
 E/AndroidRuntime(2497):     at android.app.ActivityThread.main(ActivityThread.java:3691)
 E/AndroidRuntime(2497):     at java.lang.reflect.Method.invokeNative(Native Method)
 E/AndroidRuntime(2497):     at java.lang.reflect.Method.invoke(Method.java:507)
 E/AndroidRuntime(2497):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
 E/AndroidRuntime(2497):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
 E/AndroidRuntime(2497):     at dalvik.system.NativeStart.main(Native Method)
 E/AndroidRuntime(2497): Caused by: java.lang.NoClassDefFoundError: com.qualcomm.ar.pl.CameraPreview
 E/AndroidRuntime(2497):     at java.lang.Runtime.nativeLoad(Native Method)
 E/AndroidRuntime(2497):     at java.lang.Runtime.loadLibrary(Runtime.java:432)
 E/AndroidRuntime(2497):     at java.lang.System.loadLibrary(System.java:554)
 E/AndroidRuntime(2497):     at com.qualcomm.QCARSamples.ImageTargets.ImageTargets.loadLibrary(ImageTargets.java:801)
 E/AndroidRuntime(2497):     at com.qualcomm.QCARSamples.ImageTargets.ImageTargets.<clinit>(ImageTargets.java:107)
 E/AndroidRuntime(2497):     ... 15 more
 E/AndroidRuntime(2497): Caused by: java.lang.ClassNotFoundException: com.qualcomm.ar.pl.CameraPreview in loader dalvik.system.PathClassLoader[/data/app/com.qualcomm.QCARSamples.ImageTargets-2.apk]
 E/AndroidRuntime(2497):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
 E/AndroidRuntime(2497):     at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
 E/AndroidRuntime(2497):     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
 E/AndroidRuntime(2497):     ... 20 more

A week ago ,I did get this sample to run but was facing problems with other samples.Then something weird happened.The SFK manager wouldnt show my installed android sdks.I'd 2.3.3 and 4.0 installed and it wouldnt show them!So I've reinstalled eclipse (a different version) and android SDK but now I cant even get this to work.

 

Any help will be appreciated.

Thank you.

Samples Crash

September 13, 2012 - 3:15pm #8

matthijs wrote:

I had the exact same issue. Solved it by checking the QCAR.jar under Project Properties->Java Build Path-> Order and Export tab (it was unchecked by default). This makes sure the QCAR.jar classes are compiled into your APK.

Thanks for the solution!

ps. Don't forget to CleanUp and Rebuild project.

Samples Crash

September 6, 2012 - 9:17am #7

That link is giving a 'content not available' message.

Which sample, and what's the error?

Be sure to run ndk-build from the command line in the sample's base directory.

Samples Crash

September 6, 2012 - 3:06am #6

I to got error on the sample project :(

http://www.facebook.com/photo.php?fbid=4021103964788&set=a.1406682365882.2053459.1197091335&type=3

 

if any one can help, please...
I have done all step in the vuforia web...

 

 

Samples Crash

June 24, 2012 - 4:50am #5

I had the exact same issue. Solved it by checking the QCAR.jar under Project Properties->Java Build Path-> Order and Export tab (it was unchecked by default). This makes sure the QCAR.jar classes are compiled into your APK.

Samples Crash

June 23, 2012 - 3:42pm #4

Alright I've got the samples to work.All of them ! Laughing

 

I was playing around when I found out throough google that most of the java errors are due to class paths and libraries.I didnt realize what changes I made when I got the image target sample working after playing around a bit until I read the sticky thread : Compatibility with Android SDK r17

I'd checked the QCAR option under export libraries in java build path.It solved the issue.

 

I hope this helps someone incase they face a similar issue.

Samples Crash

June 22, 2012 - 2:04pm #3

DavidBeard wrote:

Have you confirmed that the libQCAR and libImageTargets *.so files are actually in the armeabi folders under libs? - that it's not an empty folder.

Also have you been able to restore your Eclipse environment for Android, or was this built from the corrupted environment?

For now, I'd advise uninstalling the app and even rebooting the device. See if that makes any difference.

Was this the same problem that you were seeing with other samples?

And what is the OS of your build environment?

 

 

Thank you for your attention DavidBeard

Yes,both armeabi and armeabi - v7a contain the following files

gdb.setup
gdb.server
libImageTargets.so
libQCAR.so

 

I deleted the old eclipse folder (It was JAVA EE - Helios version).Now I've the Java Helios version ,downloaded it only a few days back so has to be the most recent.I can import the old android projects from my previous workspace and get them to run on my device.

 

I've uninstalled the app several times for I read somewhere that it can make a difference but that hasn't helped my situation.Just rebooted my device but that made no difference either.The app ont even get to the splash screen.

 

With other samples,I just couldnt even run them when I tried ,it kept showing an alert box saying that your program has errors.Please fix them (something on those lines when I tried to run them as an android app through eclipse).I realize that it was probably because then I'd not followed the ndk build command on every sample and proabably the QCAR classpath was messed up.I'd just started with this on that day and looked over many things.However,now I believe I've got all steps covered up...wondering whats causing this error.

 

I'm on windows 7 64 bit using 32 bit java and eclipse I believe.

My android device runs stock 2.3.5

 

I also exported the sample as .apk file ,got it on my phone and installed it manually but that didnt make any difference either.

Samples Crash

June 22, 2012 - 12:36pm #2

Have you confirmed that the libQCAR and libImageTargets *.so files are actually in the armeabi folders under libs? - that it's not an empty folder.

Also have you been able to restore your Eclipse environment for Android, or was this built from the corrupted environment?

For now, I'd advise uninstalling the app and even rebooting the device. See if that makes any difference.

Was this the same problem that you were seeing with other samples?

And what is the OS of your build environment?

 

 

Log in or register to post comments