builds and crash

hi all,

i’ve been trying to instal OF android and finally got everything to compile but when running on simulator or device it crashes…

i’m attaching a screenshot of the logcat.

anyone has any clue on what’s wrong?
really appreciate if u can point me a good direction * )

![](http://forum.openframeworks.cc/uploads/default/2450/Screen Shot 2012-06-14 at 6.38.54 PM.png)

very happy to say that finally got examples working!
in the end, recreate the ofAndroidLib build.xml file made it all fine

* )
.r

What does this mean? How did you do it?

hey Veqtor

my prblem was solved by remaking the ofAndroidLib build.xml file:
see note after step p)

Note: If you get an error about an obsolete build.xml, you can safely delete the build.xml file and recreate it using ‘android update project’. (The ‘android’ tool is at SDK_DIR/tools/android.) You may also need to do this for openFrameworks/addons/ofxAndroid/ofAndroidLib.

.r

Tried it, but it didn’t work… =(

did u made both new build.xml files?
have u looked to see if your error matches any of the behaviors described in the instal notes and FAQ ?

.r

Yep I’ve tried everything. Seems like I’m haunted by the classnotfoundexception…

  
06-21 00:08:26.458: D/AndroidRuntime(16081): Shutting down VM  
06-21 00:08:26.458: W/dalvikvm(16081): threadid=1: thread exiting with uncaught exception (group=0x2aac8578)  
06-21 00:08:26.477: E/AndroidRuntime(16081): FATAL EXCEPTION: main  
06-21 00:08:26.477: E/AndroidRuntime(16081): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{cc.openframeworks.androidEmptyExample/cc.openframeworks.androidEmptyExample.OFActivity}: java.lang.ClassNotFoundException: cc.openframeworks.androidEmptyExample.OFActivity in loader dalvik.system.PathClassLoader[/mnt/asec/cc.openframeworks.androidEmptyExample-1/pkg.apk]  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1581)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at android.app.ActivityThread.access$1500(ActivityThread.java:121)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at android.os.Handler.dispatchMessage(Handler.java:99)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at android.os.Looper.loop(Looper.java:130)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at android.app.ActivityThread.main(ActivityThread.java:3701)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at java.lang.reflect.Method.invokeNative(Native Method)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at java.lang.reflect.Method.invoke(Method.java:507)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at dalvik.system.NativeStart.main(Native Method)  
06-21 00:08:26.477: E/AndroidRuntime(16081): Caused by: java.lang.ClassNotFoundException: cc.openframeworks.androidEmptyExample.OFActivity in loader dalvik.system.PathClassLoader[/mnt/asec/cc.openframeworks.androidEmptyExample-1/pkg.apk]  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:551)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at android.app.Instrumentation.newActivity(Instrumentation.java:1021)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)  
06-21 00:08:26.477: E/AndroidRuntime(16081): 	... 11 more  
  

not sure if this will help but what NDK version are u using?
i couldn’t get my install to work with the NDK version linked from the instructions and ended using r7, also it is recommended to use 8 for OF0071.
let me know if this helps!

.r

I’m experiencing the exact same thing. I’m using the 0073 release, NDK r8b, and just trying to compile any of the included examples.

Just like mentioned, they build fine, but crash with the same “Unable to instantiate activity ComponentInfo … ClassNotFoundException: cc.openFrameworks.androidPolygonExample.OFActivity” nonsense.

I’m tearing my hair out, here. I actually wiped and installed a fresh copy of Ubuntu on a second computer to try it out there but experienced *exactly* the same thing.

Has anyone else with this problem found a workaround?

Has anybody solved this ?

Yeah, I finally found this thread. I’m in the same spot. 0073, r8b and the dreaded java.lang.ClassNotFoundException. I’m about to revert to an older ndk and other version of OF to at least get something working to show for my time/hair/sweat

okay, I’ve made a lot of noise on the forums here today … this issue is resolved.

I upgraded to OF 0.7.4 (which is brand new) and NDK r8d and following the instructions, my classes are generated correctly and my activity loads as expected! Success!! Thanks to all who worked on this latest release!