Cocos2d-x crash when adding code to Android.mk

Hi everyone!

I’m having horrible trouble migrating to 3.x! Please help!

I’ve updated my game to compile and run fine under iOS but it crashes during launch on Android. :frowning: The error I get is this:

********** Crash dump: **********
Build fingerprint: 'samsung/yakjuxw/maguro:4.2.1/JOP40D/I9250XWMA2:user/release-keys'
pid: 22977, tid: 22977, name: WOOOHOO  >>> WOOOHOO <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
Stack frame #00  pc 00a33fd0  /data/app-lib/WOOOHOO-1/libcocos2dcpp.so (_JavaVM::GetEnv(void**, int)+28)
Stack frame #01  pc 00a34608  /data/app-lib/WOOOHOO-1/libcocos2dcpp.so (cocos2d::JniHelper::cacheEnv(_JavaVM*)+44)
Crash dump is completed

I cannot figure this out! I’ve tried running the cpp tests, they work. I’ve tried creating clean projects from clean extractions of the 3.1 and 3.2 zips, they work. It is when I copy my cpp/h-files into the Classes directory and add all my code in Android.mk (and add -fexceptions in Application.mk) that I get this error. I can add SOME of the code, but once I add all the menus it crashes on launch. I even get the error BEFORE hooking in my code into the default AppDelegate from the clean 3.1/3.2 project! Thus, my code makes the game crash without ever being called. :frowning:

Something is seriously weird here, I can’t figure this out.

(I made a cross-post on stackoverflow, it might have more details)