Hello guys, i am using cocos2d-x with eclipse. I’ve got a common problem: my hellocpp can’t last a lot. It crashes and I get the message “Unfortunately app-name has stopped” on emulator. I have read a lot of other topics but I couldn’t fix that.
The emulator is using GPU Host.
I’m using Ubuntu, and if i do “cocos run -p linux” i have the APP running perfectly. It doesn’t work at Android Platform. I’ve tried to install it in my phone, but with no success.
I have the newest version (cocos2d-x-3.0rc1).
Logcat message:
04-09 14:56:25.940: E/AndroidRuntime(1329): FATAL EXCEPTION: main
04-09 14:56:25.940: E/AndroidRuntime(1329): Process: org.cocos2dx.hellocpp, PID: 1329
04-09 14:56:25.940: E/AndroidRuntime(1329): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.cocos2dx.hellocpp/org.cocos2dx.cpp.AppActivity}: java.lang.ClassNotFoundException: Didn’t find class “org.cocos2dx.cpp.AppActivity” on path: DexPathList[[zip file “/data/app/org.cocos2dx.hellocpp-2.apk”],nativeLibraryDirectories=[/data/app-lib/org.cocos2dx.hellocpp-2, /system/lib]]
04-09 14:56:25.940: E/AndroidRuntime(1329): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
04-09 14:56:25.940: E/AndroidRuntime(1329): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
04-09 14:56:25.940: E/AndroidRuntime(1329): at android.app.ActivityThread.access$800(ActivityThread.java:135)
04-09 14:56:25.940: E/AndroidRuntime(1329): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
04-09 14:56:25.940: E/AndroidRuntime(1329): at android.os.Handler.dispatchMessage(Handler.java:102)
04-09 14:56:25.940: E/AndroidRuntime(1329): at android.os.Looper.loop(Looper.java:136)
04-09 14:56:25.940: E/AndroidRuntime(1329): at android.app.ActivityThread.main(ActivityThread.java:5017)
04-09 14:56:25.940: E/AndroidRuntime(1329): at java.lang.reflect.Method.invokeNative(Native Method)
04-09 14:56:25.940: E/AndroidRuntime(1329): at java.lang.reflect.Method.invoke(Method.java:515)
04-09 14:56:25.940: E/AndroidRuntime(1329): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
04-09 14:56:25.940: E/AndroidRuntime(1329): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
04-09 14:56:25.940: E/AndroidRuntime(1329): at dalvik.system.NativeStart.main(Native Method)
04-09 14:56:25.940: E/AndroidRuntime(1329): Caused by: java.lang.ClassNotFoundException: Didn’t find class “org.cocos2dx.cpp.AppActivity” on path: DexPathList[[zip file “/data/app/org.cocos2dx.hellocpp-2.apk”],nativeLibraryDirectories=[/data/app-lib/org.cocos2dx.hellocpp-2, /system/lib]]
04-09 14:56:25.940: E/AndroidRuntime(1329): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
04-09 14:56:25.940: E/AndroidRuntime(1329): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
04-09 14:56:25.940: E/AndroidRuntime(1329): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
04-09 14:56:25.940: E/AndroidRuntime(1329): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
04-09 14:56:25.940: E/AndroidRuntime(1329): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
04-09 14:56:25.940: E/AndroidRuntime(1329): … 11 more