Log in or register to post comments

NoClassDefFoundError: com.qualcomm.ar.pl.CameraPreview

April 1, 2012 - 12:53pm #1


I have problems with the sample apps (all of them): right after the app starts it crashes immediately with a NoClassDefFoundError. I modified the java code to catch the error by inserting a new catch into the public static boolean loadLibrary(String nLibName) function, so now I'm getting the following error (I also printed out the stack trace):

04-01 21:15:19.622: ERROR/QCAR(4985): The library libQCAR.so could not be loaded: com.qualcomm.ar.pl.CameraPreview
04-01 21:15:19.622: WARN/System.err(4985): java.lang.NoClassDefFoundError: com.qualcomm.ar.pl.CameraPreview
04-01 21:15:19.622: WARN/System.err(4985): at java.lang.Runtime.nativeLoad(Native Method)
04-01 21:15:19.622: WARN/System.err(4985): at java.lang.Runtime.loadLibrary(Runtime.java:432)
04-01 21:15:19.632: WARN/System.err(4985): at java.lang.System.loadLibrary(System.java:554)
04-01 21:15:19.632: WARN/System.err(4985): at com.qualcomm.QCARSamples.Dominoes.Dominoes.loadLibrary(Dominoes.java:796)
04-01 21:15:19.632: WARN/System.err(4985): at com.qualcomm.QCARSamples.Dominoes.Dominoes.(Dominoes.java:107)
04-01 21:15:19.632: WARN/System.err(4985): at java.lang.Class.newInstanceImpl(Native Method)
04-01 21:15:19.632: WARN/System.err(4985): at java.lang.Class.newInstance(Class.java:1409)
04-01 21:15:19.632: WARN/System.err(4985): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
04-01 21:15:19.632: WARN/System.err(4985): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
04-01 21:15:19.632: WARN/System.err(4985): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
04-01 21:15:19.632: WARN/System.err(4985): at android.app.ActivityThread.access$1500(ActivityThread.java:121)
04-01 21:15:19.632: WARN/System.err(4985): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
04-01 21:15:19.632: WARN/System.err(4985): at android.os.Handler.dispatchMessage(Handler.java:99)
04-01 21:15:19.632: WARN/System.err(4985): at android.os.Looper.loop(Looper.java:123)
04-01 21:15:19.632: WARN/System.err(4985): at android.app.ActivityThread.main(ActivityThread.java:3701)
04-01 21:15:19.632: WARN/System.err(4985): at java.lang.reflect.Method.invokeNative(Native Method)
04-01 21:15:19.632: WARN/System.err(4985): at java.lang.reflect.Method.invoke(Method.java:507)
04-01 21:15:19.632: WARN/System.err(4985): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
04-01 21:15:19.632: WARN/System.err(4985): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
04-01 21:15:19.632: WARN/System.err(4985): at dalvik.system.NativeStart.main(Native Method)
04-01 21:15:19.632: WARN/System.err(4985): Caused by: java.lang.ClassNotFoundException: com.qualcomm.ar.pl.CameraPreview in loader dalvik.system.PathClassLoader[/data/app/com.qualcomm.QCARSamples.Dominoes-2.apk]
04-01 21:15:19.642: WARN/System.err(4985): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
04-01 21:15:19.642: WARN/System.err(4985): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
04-01 21:15:19.642: WARN/System.err(4985): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-01 21:15:19.642: WARN/System.err(4985): ... 20 more

Now I can see the splash screen but after that it closes without any message. As you can see, there is some problem with com.qualcomm.ar.pl.CameraPreview

My phone is a SonyEricsson X10i with Android version 2.3.3
I am using the latest Vuforia SDK 1.5.9 and Android NDK r7b.

About half year ago I was successfully able to try the sample projects on this phone with Android version 2.1.update-1 and the former QCAR SDK 1.0.6 and NDK r6b.

Can you help me solving this error?
Thanks in advance,

Re: NoClassDefFoundError: com.qualcomm.ar.pl.CameraPreview

May 10, 2012 - 4:04am #7

I guess had the same problem or at least very similar, and the link provided solved for me. Thanks.

Re: NoClassDefFoundError: com.qualcomm.ar.pl.CameraPreview

April 5, 2012 - 4:19pm #6

That's strange, it helped someone else with the same error:


You may want to try reinstalling the SDK at this point.

- Kim

Re: NoClassDefFoundError: com.qualcomm.ar.pl.CameraPreview

April 5, 2012 - 2:17pm #5

I didn't updated my ADT, but I tried those instructions anyways. Unfortunately, it did not helped :(

(I was not able to login here on 3rd and 4th of April, that's why I didn't respond earlier.)

I tried the compiled app on a Motoraly Defy+ and the error is the same, so it should be independent from the handset.

Re: NoClassDefFoundError: com.qualcomm.ar.pl.CameraPreview

April 2, 2012 - 1:56am #4

If you updated you're ADT recently to r17 then have a look at this sticky - http://ar.qualcomm.at/node/2001873

It looks similar to problems I was having and this solved it for me.

Re: NoClassDefFoundError: com.qualcomm.ar.pl.CameraPreview

April 1, 2012 - 2:29pm #3

Yes, I tried to build, re-bulid the NDK files; clean, build, rebuild the java files and also to remove the project from the workspace, from the HDD; uninstall the app from the phone. I also tried to use Android SDK API-7 and API-10; NDK r6b and r7b.

libQRAR.so is in the following folders:
I also checked it in the apk file, it is in the lib folder.

Re: NoClassDefFoundError: com.qualcomm.ar.pl.CameraPreview

April 1, 2012 - 1:43pm #2

Are you running ndk-build on these, and cleaning the project in Eclipse afterwards?

Do you see libQCAR.so in the ARM folders under [SampeName]/obj/..

Log in or register to post comments