There would be several potential reasons, logs are required. But it’s nothing about ndk r7, we released our FishingJoy based on cocos2d-0.11.0 & ndk r7, it runs smoothly.
The 1st point is is that, this->setIsTouchEnabled(true) is the mechanic for “standard touch delegate”, wile registerWithTouchDispatcher is another mechanic for “targeted touch delegate”. You can learn their difference from here http://www.cocos2d-iphone.org/wiki/doku.php/tips:touchdelegates?s[]=touch&s[]=delegate I have never use them synchronously in one layer, so I don’t know what the result would be.
Second, pay attention to release/retain/autorelease of your layer, invoking methods of a released object would raise a crash in cpp, while in objective-c it’s safe.
I’m just a complete noob with cocos2d-x, but I believe this has something to do with the code generated by the create-android-project script. If I open HelloWorld from the cocos2d-x folder, run the build-native script and then create the project in Eclipse and run it, it works perfectly. However, if I create a new project with the create-android-project script and do the same steps, the application runs but whenever I tap anywhere on the screen the application quits without any error in the console. I’m running Android SDK 4, NDK r7 on MacOS X, using a 2.3.3 AVD emulator.
Please note though that this is EXACTLY the output of create-android-project.sh, I haven’t changed a single line of code. The only thing I did was run build_native, open the project in Eclipse and run it. Thanks!
Hi Minggo Zhang: Walzer helped me to make it work. But I still don’t know what was the problem. since he sent me back the project after the modification, I run it on my kindler fire, it works. then I copied to Classes and Resources directories into my own project, the problem is still there (touch the screen and the app exit) .
So I just use the project Walzer sent to me and modified the configurations files to match my development env, then compiled the project and run it , the app seems like ok.