I'm having horrible troubles migrating to Cocos2d-x 3.x. Everything works perfectly on iOS (of course it does...) but crashes during startup on Android.
The error I'm getting 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
What I've tried
First I tried running the cpp tests that come with Cocos2d-x (from a clean extraction of cocos2d-x-3.2.zip). They work fine.
Then I tried creating a new project from scratch using the cocos
command. It compiles and WORKS. I tried this using both 3.1 and 3.2.
THEN I tried adding my own sources to this project. This is where things get weird. I can add some of the files but adding them all does not work. EVEN WHEN THE CODE IS NEVER CALLED FROM THE DEFAULT AppDelegate... The same thing happens in both 3.1 and 3.2.
Modifications to Android.mk
The only modification I've made to the proj.android/jni/Android.mk file is adding -fexceptions
to APP_CPPFLAGS
.
Modifications to Android.mk
The only modifications I've made to the proj.android/jni/Android.mk file are adding these lines to search for code
CPP_FILE_LIST := $(LOCAL_PATH)/hellocpp/main.cpp
CPP_FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)
CPP_FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/**/*.cpp)
CPP_FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/**/**/*.cpp)
CPP_FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/libs/jansson-2.6/*.c)
LOCAL_SRC_FILES := $(CPP_FILE_LIST:$(LOCAL_PATH)/%=%)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \
$(LOCAL_PATH)/../../Classes/map \
$(LOCAL_PATH)/../../Classes/menus \
$(LOCAL_PATH)/../../Classes/util \
$(LOCAL_PATH)/../../Classes/worlds \
$(LOCAL_PATH)/../../Classes/libs/jansson-2.6
and uncommenting
LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static
$(call import-module,editor-support/cocostudio)
because I use some widgets from the new ui namespace.
What is wrong? I can't figure this out...