Log in or register to post comments

ANR on sample projects

December 12, 2012 - 3:56am #1

I tried to launch Virtual Buttons project and Dominoes project but both give the same error.

all I can tell is something wrong with the library loading. 

 

yes I already did the ndk-build so I don't really understand what's the problem with that..

 

here is the stack trace.

 

12-12 18:33:16.985: E/AndroidRuntime(20064): FATAL EXCEPTION: main

12-12 18:33:16.985: E/AndroidRuntime(20064): java.lang.ExceptionInInitializerError

12-12 18:33:16.985: E/AndroidRuntime(20064): at java.lang.Class.newInstanceImpl(Native Method)

12-12 18:33:16.985: E/AndroidRuntime(20064): at java.lang.Class.newInstance(Class.java:1319)

12-12 18:33:16.985: E/AndroidRuntime(20064): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)

12-12 18:33:16.985: E/AndroidRuntime(20064): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1882)

12-12 18:33:16.985: E/AndroidRuntime(20064): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)

12-12 18:33:16.985: E/AndroidRuntime(20064): at android.app.ActivityThread.access$600(ActivityThread.java:127)

12-12 18:33:16.985: E/AndroidRuntime(20064): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)

12-12 18:33:16.985: E/AndroidRuntime(20064): at android.os.Handler.dispatchMessage(Handler.java:99)

12-12 18:33:16.985: E/AndroidRuntime(20064): at android.os.Looper.loop(Looper.java:137)

12-12 18:33:16.985: E/AndroidRuntime(20064): at android.app.ActivityThread.main(ActivityThread.java:4448)

12-12 18:33:16.985: E/AndroidRuntime(20064): at java.lang.reflect.Method.invokeNative(Native Method)

12-12 18:33:16.985: E/AndroidRuntime(20064): at java.lang.reflect.Method.invoke(Method.java:511)

12-12 18:33:16.985: E/AndroidRuntime(20064): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:823)

12-12 18:33:16.985: E/AndroidRuntime(20064): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)

12-12 18:33:16.985: E/AndroidRuntime(20064): at dalvik.system.NativeStart.main(Native Method)

12-12 18:33:16.985: E/AndroidRuntime(20064): Caused by: java.lang.NoClassDefFoundError: com/qualcomm/ar/pl/CameraPreview

12-12 18:33:16.985: E/AndroidRuntime(20064): at java.lang.Runtime.nativeLoad(Native Method)

12-12 18:33:16.985: E/AndroidRuntime(20064): at java.lang.Runtime.loadLibrary(Runtime.java:368)

12-12 18:33:16.985: E/AndroidRuntime(20064): at java.lang.System.loadLibrary(System.java:535)

12-12 18:33:16.985: E/AndroidRuntime(20064): at com.qualcomm.QCARSamples.VirtualButtons.VirtualButtons.loadLibrary(VirtualButtons.java:783)

12-12 18:33:16.985: E/AndroidRuntime(20064): at com.qualcomm.QCARSamples.VirtualButtons.VirtualButtons.<clinit>(VirtualButtons.java:113)

12-12 18:33:16.985: E/AndroidRuntime(20064): ... 15 more

12-12 18:33:16.985: E/AndroidRuntime(20064): Caused by: java.lang.ClassNotFoundException: com.qualcomm.ar.pl.CameraPreview

12-12 18:33:16.985: E/AndroidRuntime(20064): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)

12-12 18:33:16.985: E/AndroidRuntime(20064): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)

12-12 18:33:16.985: E/AndroidRuntime(20064): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)

12-12 18:33:16.985: E/AndroidRuntime(20064): ... 20 more

 

ANR on sample projects

December 12, 2012 - 4:30am #3

Hi,

this is a frequently reported issue;

what you need to do is:

- go to project Properties > Java Build Path -> select the "Order and Export"  tab

- here you must enable the checkbox of the QCAR.jar dependency (i.e. "QCAR_SDK_ROOT/....")

- then Apply/OK and make a clean / build (also, make sure to refresh the project whenever you ndk-build)

That should solve the problem. 

In some rare cases you also need to restart Eclipse (after having done the steps above)

 

ANR on sample projects

December 12, 2012 - 4:29am #2

oh by the way I tested it on 2 devices :

1. sony xperia sola with Android 4.0.4 (ICS)
2. Galaxy Tab original with Android 2.2 (froyo) 

Log in or register to post comments