cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.22k stars 7.06k forks source link

New app crash on Android #16510

Open wduminy opened 8 years ago

wduminy commented 8 years ago

Steps to Reproduce:

  1. cocos new cocostest -p com.cocostest -l cpp
  2. cocos run -p android --app-abi x86 -m debug
  3. App starts up fine, all seems OK
  4. Wait a little while (maybe 10 seconds or so), the app crashes
Shulepov commented 8 years ago

Try to compile with NDK r10c, recently also encountered similar crashes with ndk r10e after updating cocos2d-x.

dumganhar commented 8 years ago

@codespear , I tested it with cocos2d-x 3.13 & ndk-10e & x86 simulator, and I didn't find the crash you said. BTW, the screenSize section in AndroidManifest.xml should be deleted since we reverted to use API 10 in v3.13.

Could you check that which API version you're using? And could you provide the logcat output?

wduminy commented 8 years ago

@dabingnn , I am using platform 4.4.2 (API 19).
Get the logcat output from dropbox.

dumganhar commented 8 years ago

@codespear, it's probably a bug of our x86 optimized code. You could try to disable __SSE__ optimization in Application.mk by adding

APP_CPPFLAGS += -U__SSE__

Let me know whether this workaround works for you.

wduminy commented 8 years ago

@dumganhar I tried it and it still crashed. When I get a bit of time I will try other variations of the SDK and NDK.

wduminy commented 8 years ago

I reproduced crash with NDK 10c, sticking to API 19. Not sure how important this is but I am also using an Atom x86 emulator.

Good news is that there is no crash with NDK 10c and API level 22.