Unfortunately hellocpp has stopped

Hi, I’m new to android develop, and I run into this too, did your guys have an solution or workaround here? Thank you.

Is there any solution?I’m new to android too and I almost give up

I got same problem with cocos2d-x 2.1.4 and project build target Android 4.2.2 API level 17 with use host GPU see below images

This is a LogCat.
10-25 17:47:49.421: E/AndroidRuntime(329): FATAL EXCEPTION: main 10-25 17:47:49.421: E/AndroidRuntime(329): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.cocos2dx.hellocpp/org.cocos2dx.hellocpp.HelloCpp}: java.lang.ClassNotFoundException: org.cocos2dx.hellocpp.HelloCpp in loader dalvik.system.PathClassLoader[/data/app/org.cocos2dx.hellocpp-1.apk] 10-25 17:47:49.421: E/AndroidRuntime(329): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569) 10-25 17:47:49.421: E/AndroidRuntime(329): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 10-25 17:47:49.421: E/AndroidRuntime(329): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 10-25 17:47:49.421: E/AndroidRuntime(329): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 10-25 17:47:49.421: E/AndroidRuntime(329): at android.os.Handler.dispatchMessage(Handler.java:99) 10-25 17:47:49.421: E/AndroidRuntime(329): at android.os.Looper.loop(Looper.java:123) 10-25 17:47:49.421: E/AndroidRuntime(329): at android.app.ActivityThread.main(ActivityThread.java:3683) 10-25 17:47:49.421: E/AndroidRuntime(329): at java.lang.reflect.Method.invokeNative(Native Method) 10-25 17:47:49.421: E/AndroidRuntime(329): at java.lang.reflect.Method.invoke(Method.java:507) 10-25 17:47:49.421: E/AndroidRuntime(329): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 10-25 17:47:49.421: E/AndroidRuntime(329): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 10-25 17:47:49.421: E/AndroidRuntime(329): at dalvik.system.NativeStart.main(Native Method) 10-25 17:47:49.421: E/AndroidRuntime(329): Caused by: java.lang.ClassNotFoundException: org.cocos2dx.hellocpp.HelloCpp in loader dalvik.system.PathClassLoader[/data/app/org.cocos2dx.hellocpp-1.apk] 10-25 17:47:49.421: E/AndroidRuntime(329): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240) 10-25 17:47:49.421: E/AndroidRuntime(329): at java.lang.ClassLoader.loadClass(ClassLoader.java:551) 10-25 17:47:49.421: E/AndroidRuntime(329): at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 10-25 17:47:49.421: E/AndroidRuntime(329): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 10-25 17:47:49.421: E/AndroidRuntime(329): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561) 10-25 17:47:49.421: E/AndroidRuntime(329): ... 11 more

http://kongarn.com/images/Eclipse_config/log.txt

When I installed HelloCpp.apk on nexus4 android 4.3 latest version but I got error “Unfortunately, HelloCpp has stopped”
How can I fix it?

For those that wind up here in the future, one potential problem could be your emulator. Play around with it. Screen size shouldn’t matter, but the emulated CPU just might. I was trying mine on an Intel Atom (x86) Android v4.3 emulator. It would fail with the above error EVERY TIME. I created another emulator, this time as ARM (armabi-v7a) Android v4.3 and like magic, there it was, working. If it works for you, before you cheer with your head all sideways, just hit ctrl+F11. Good luck, all!

Carrie,
There is an wiki page explaining how to add support for x86 in your Cocos2d-x Apps, it is very easy:
[[http://www.cocos2d-x.org/wiki/Build_HelloWorld_on_android_x86_platform]]

summarizing the page:

  1. Support x86 and armxxx
    Change the APP_ABI in HelloWorld/android/jni/Application.mk

@ APP_ABI := armeabi armeabi-v7a x86 @

I have the same problem on emulator and on device too. I use cocos2d-x 3.0 alpha1. I have also changed to version 2.2.1 and here is the Log in Eclipse:

11-23 12:49:09.990: D/dalvikvm(921): Trying to load lib /data/app-lib/org.cocos2dx.hellocpp-1/libhellocpp.so 0xb3d0dd40
11-23 12:49:10.060: D/dalvikvm(921): Added shared lib /data/app-lib/org.cocos2dx.hellocpp-1/libhellocpp.so 0xb3d0dd40
11-23 12:49:11.010: D/Cocos2dxActivity(921): model=sdk
11-23 12:49:11.010: D/Cocos2dxActivity(921): product=sdk
11-23 12:49:11.020: D/Cocos2dxActivity(921): isEmulator=true
11-23 12:49:12.820: I/Choreographer(921): Skipped 62 frames! The application may be doing too much work on its main thread.
11-23 12:49:15.110: I/Choreographer(921): Skipped 502 frames! The application may be doing too much work on its main thread.
11-23 12:49:15.160: W/dalvikvm(921): threadid=12: thread exiting with uncaught exception (group=0xb3a4ab90)
11-23 12:49:15.270: E/AndroidRuntime(921): FATAL EXCEPTION: GLThread 79
11-23 12:49:15.270: E/AndroidRuntime(921): Process: org.cocos2dx.hellocpp, PID: 921
11-23 12:49:15.270: E/AndroidRuntime(921): java.lang.IllegalArgumentException: No configs match configSpec
11-23 12:49:15.270: E/AndroidRuntime(921): at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:863)
11-23 12:49:15.270: E/AndroidRuntime(921): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1024)
11-23 12:49:15.270: E/AndroidRuntime(921): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1401)
11-23 12:49:15.270: E/AndroidRuntime(921): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
11-23 12:49:15.390: D/gralloc_goldfish(921): Emulator without GPU emulation detected.
11-23 12:49:15.870: I/Choreographer(921): Skipped 74 frames! The application may be doing too much work on its main thread.
11-23 12:49:25.120: I/Process(921): Sending signal. PID: 921 SIG: 9
11-23 12:49:25.130: W/IInputConnectionWrapper(921): showStatusIcon on inactive InputConnection

Please help.

Hi Guys,

i am also facing the same problem.please help me to resolve in this.Please find the logs below.

01-28 15:18:03.615: E/AndroidRuntime(7421): FATAL EXCEPTION: main
01-28 15:18:03.615: E/AndroidRuntime(7421): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.cocos2dx.hellocpp/org.cocos2dx.hellocpp.Cocos2dxActivity}: java.lang.IllegalArgumentException: Unable to find native library: hellocpp
01-28 15:18:03.615: E/AndroidRuntime(7421): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2062)
01-28 15:18:03.615: E/AndroidRuntime(7421): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2087)
01-28 15:18:03.615: E/AndroidRuntime(7421): at android.app.ActivityThread.access$600(ActivityThread.java:133)
01-28 15:18:03.615: E/AndroidRuntime(7421): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1198)
01-28 15:18:03.615: E/AndroidRuntime(7421): at android.os.Handler.dispatchMessage(Handler.java:99)
01-28 15:18:03.615: E/AndroidRuntime(7421): at android.os.Looper.loop(Looper.java:137)
01-28 15:18:03.615: E/AndroidRuntime(7421): at android.app.ActivityThread.main(ActivityThread.java:4803)
01-28 15:18:03.615: E/AndroidRuntime(7421): at java.lang.reflect.Method.invokeNative(Native Method)
01-28 15:18:03.615: E/AndroidRuntime(7421): at java.lang.reflect.Method.invoke(Method.java:511)
01-28 15:18:03.615: E/AndroidRuntime(7421): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
01-28 15:18:03.615: E/AndroidRuntime(7421): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
01-28 15:18:03.615: E/AndroidRuntime(7421): at dalvik.system.NativeStart.main(Native Method)
01-28 15:18:03.615: E/AndroidRuntime(7421): Caused by: java.lang.IllegalArgumentException: Unable to find native library: hellocpp
01-28 15:18:03.615: E/AndroidRuntime(7421): at android.app.NativeActivity.onCreate(NativeActivity.java:181)
01-28 15:18:03.615: E/AndroidRuntime(7421): at org.cocos2dx.hellocpp.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:11)
01-28 15:18:03.615: E/AndroidRuntime(7421): at android.app.Activity.performCreate(Activity.java:5008)
01-28 15:18:03.615: E/AndroidRuntime(7421): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
01-28 15:18:03.615: E/AndroidRuntime(7421): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2026)
01-28 15:18:03.615: E/AndroidRuntime(7421): … 11 more

I guess the solution is to not use Cocos2d-x.

it is not able to find cocos2dx java files
copy the src
cocos2d-x-2.2.2\cocos2dx\platform\android\java\src
folder to ur project
**/src folder issue wil be solved

I did that, now I receive this while compiling:

[2014-02-25 00:28:32 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/cocos2dx/lib/Cocos2dxAccelerometer;
[2014-02-25 00:28:32 - HelloCpp] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/cocos2dx/lib/Cocos2dxAccelerometer;
[2014-02-25 00:29:22 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/cocos2dx/lib/Cocos2dxAccelerometer;
[2014-02-25 00:29:22 - HelloCpp] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/cocos2dx/lib/Cocos2dxAccelerometer;

I figured it out (for me at least). Make sure the environment variables are set right. The tutorial that cocos2d uses, sets the paths in the Environment Variables as “c:-…” as opposed to the correct way “c:…”

Hello, I also have another :

I’m using a x64 Eclipse+ADT setup with cocos2d-x-3.0beta2, android-ndk-r9c…

The HelloApp fails in both emulator and Galaxy Note2.

The emulator settings:
CPU: ARM (armeabi-v7a)
1280x720 resolution and 512M memory.
latest Android 4.4.2

Traces:

03-01 05:22:04.110: D/AndroidRuntime(1167): Shutting down VM
03-01 05:22:04.110: W/dalvikvm(1167): threadid=1: thread exiting with uncaught exception (group=0xb1ac6ba8)
03-01 05:22:04.240: E/AndroidRuntime(1167): FATAL EXCEPTION: main
03-01 05:22:04.240: E/AndroidRuntime(1167): Process: org.cocos2dx.hellocpp, PID: 1167
03-01 05:22:04.240: E/AndroidRuntime(1167): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.cocos2dx.hellocpp/org.cocos2dx.hellocpp.Cocos2dxActivity}: java.lang.IllegalArgumentException: Unable to find native library: hellocpp
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at android.app.ActivityThread.access$800(ActivityThread.java:135)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at android.os.Handler.dispatchMessage(Handler.java:102)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at android.os.Looper.loop(Looper.java:136)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at android.app.ActivityThread.main(ActivityThread.java:5017)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at java.lang.reflect.Method.invokeNative(Native Method)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at java.lang.reflect.Method.invoke(Method.java:515)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at dalvik.system.NativeStart.main(Native Method)
03-01 05:22:04.240: E/AndroidRuntime(1167): Caused by: java.lang.IllegalArgumentException: Unable to find native library: hellocpp
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at android.app.NativeActivity.onCreate(NativeActivity.java:171)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at org.cocos2dx.hellocpp.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:11)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at android.app.Activity.performCreate(Activity.java:5231)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
03-01 05:22:04.240: E/AndroidRuntime(1167): 	... 11 more
03-01 05:24:36.320: I/Process(1167): Sending signal. PID: 1167 SIG: 9

Any idea what’s going on?

Thank you in advance.

this is frustrating. I also downloaded Cocos2d-x 2 (instead of v.3) and I get exactly the same error in both the Android simulator AND the Galaxy Note2… I think there is something missing…

I don’t give up.
To avoid problems, I reinstalled EVERYTHING with 32 bits. Java 32 bits, CYGWIN 32 bits, and so on.
I repeated the procedures, and when I try to run HelloCpp (or SimpleGame) I get:

03-02 22:44:21.864: I/Process(380): Sending signal. PID: 380 SIG: 9
03-02 22:45:18.564: D/AndroidRuntime(409): Shutting down VM
03-02 22:45:18.564: W/dalvikvm(409): threadid=1: thread exiting with uncaught exception (group=0x40015560)
03-02 22:45:18.604: E/AndroidRuntime(409): FATAL EXCEPTION: main
03-02 22:45:18.604: E/AndroidRuntime(409): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.cocos2dx.simplegame/org.cocos2dx.simplegame.Cocos2dxActivity}: java.lang.IllegalArgumentException: Unable to find native library: game
...

I’m about to give up, but want to get this running. Can anybody give me an advice?

Thank you in advance.

@ptolomeo you can create a new directory in the folder proj.android,named assets.then copy the files in the folder Resources to this folder,this solves my problem:;ok

china_zhao_zepeng wrote:

@ptolomeo you can create a new directory in the folder proj.android,named assets.then copy the files in the folder Resources to this folder,this solves my problem:;ok

Thank you, I will try it when I come back home, but thank you anyway.
I will post the results later.

Hi all,

Could you please say more about your environment and steps to reproduce it:

  • what’s the engine version
  • how did you create a new project
  • what’s your ndk version
  • which device did you run on
  • which platform you build your program, windows, linux or mac
  • how to reproduce it

Detail information will help to find the bug more easy.
Thanks.

ptolomeo wrote:

I don’t give up.
To avoid problems, I reinstalled EVERYTHING with 32 bits. Java 32 bits, CYGWIN 32 bits, and so on.
I repeated the procedures, and when I try to run HelloCpp (or SimpleGame) I get:

03-02 22:44:21.864: I/Process(380): Sending signal. PID: 380 SIG: 9
03-02 22:45:18.564: D/AndroidRuntime(409): Shutting down VM
03-02 22:45:18.564: W/dalvikvm(409): threadid=1: thread exiting with uncaught exception (group=0x40015560)
03-02 22:45:18.604: E/AndroidRuntime(409): FATAL EXCEPTION: main
03-02 22:45:18.604: E/AndroidRuntime(409): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.cocos2dx.simplegame/org.cocos2dx.simplegame.Cocos2dxActivity}: java.lang.IllegalArgumentException: Unable to find native library: game
...

I’m about to give up, but want to get this running. Can anybody give me an advice?

Thank you in advance.

The log Unable to find native library: game means you didn’t build native codes, or it failed to generate .so.

stephenbaka wrote:

I did that, now I receive this while compiling:

[2014-02-25 00:28:32 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/cocos2dx/lib/Cocos2dxAccelerometer;
[2014-02-25 00:28:32 - HelloCpp] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/cocos2dx/lib/Cocos2dxAccelerometer;
[2014-02-25 00:29:22 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/cocos2dx/lib/Cocos2dxAccelerometer;
[2014-02-25 00:29:22 - HelloCpp] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/cocos2dx/lib/Cocos2dxAccelerometer;

Did you copy java files shipped with engine into your project?

china_zhao_zepeng wrote:

@ptolomeo you can create a new directory in the folder proj.android,named assets.then copy the files in the folder Resources to this folder,this solves my problem:;ok
Sorry pal, it didn’t work ;-(

zhangxm wrote:

The log Unable to find native library: game means you didn’t build native codes, or it failed to generate .so.

I am using windows8. Could you give me a hint on how to do that (or how to disable that functionallity from the HelloCpp project?

Thank you in advance.