Problem launching HelloCpp

Hi there,

I am very new to cocos2dx and having difficulty launching the HelloCpp project. I am using 2.0.4. I have setup my enviroment without problems (jdk, sdk, ndk, eclipse). Everything seems to compile fine (from terminal via samples/HelloCpp/proj.android/build_native.sh and from eclipse also). However when I right click and click “Run as Android application” I get the following errors:

11-05 23:01:00.126: E/AndroidRuntime(402): FATAL EXCEPTION: main
11-05 23:01:00.126: E/AndroidRuntime(402): 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]
11-05 23:01:00.126: E/AndroidRuntime(402): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
11-05 23:01:00.126: E/AndroidRuntime(402): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
11-05 23:01:00.126: E/AndroidRuntime(402): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-05 23:01:00.126: E/AndroidRuntime(402): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-05 23:01:00.126: E/AndroidRuntime(402): at android.os.Handler.dispatchMessage(Handler.java:99)
11-05 23:01:00.126: E/AndroidRuntime(402): at android.os.Looper.loop(Looper.java:123)
11-05 23:01:00.126: E/AndroidRuntime(402): at android.app.ActivityThread.main(ActivityThread.java:4627)
11-05 23:01:00.126: E/AndroidRuntime(402): at java.lang.reflect.Method.invokeNative(Native Method)
11-05 23:01:00.126: E/AndroidRuntime(402): at java.lang.reflect.Method.invoke(Method.java:521)
11-05 23:01:00.126: E/AndroidRuntime(402): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-05 23:01:00.126: E/AndroidRuntime(402): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-05 23:01:00.126: E/AndroidRuntime(402): at dalvik.system.NativeStart.main(Native Method)
11-05 23:01:00.126: E/AndroidRuntime(402): Caused by: java.lang.ClassNotFoundException: org.cocos2dx.hellocpp.HelloCpp in loader dalvik.system.PathClassLoader[/data/app/org.cocos2dx.hellocpp-1.apk]
11-05 23:01:00.126: E/AndroidRuntime(402): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
11-05 23:01:00.126: E/AndroidRuntime(402): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
11-05 23:01:00.126: E/AndroidRuntime(402): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
11-05 23:01:00.126: E/AndroidRuntime(402): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
11-05 23:01:00.126: E/AndroidRuntime(402): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
11-05 23:01:00.126: E/AndroidRuntime(402): … 11 more
11-05 23:06:00.286: I/Process(402): Sending signal. PID: 402 SIG: 9


snapshot1.png (222.3 KB)

Here is also the expanded apk file (see image).

Dimitris I have your same issue, were you able to find a solution?

Lorenzo Nuvoletta wrote:

Dimitris I have your same issue, were you able to find a solution?

Yes and it is kind of crazy but I have reproduced it again. It happens the first time I launch eclipse, after the installation of the android plugin. Everything seems to compile perfectly, though this error appears. After at least on restart of Eclipse, the problem disappears forever (for me).

it’s because of template creator
Manifest.xml is created with package ( package=“org.cocos2dx.hellocpp”)
you must change it to your package name that the hellocpp is in it

it’s done.