Skip to content

Android crashing on first launch #17360

@xdeop

Description

@xdeop
  • cocos2d-x version: 3.13.1
  • devices test on: Nexus 7 (2012) with Android 5.1.1 and Samsung Galaxy Alpha with Android 5.0.2
  • developing environments
    • NDK version: r13b
    • Xcode version: 8.2.1

On first start of application, it crashes with the following log:

02-13 17:53:11.909 122-122/? I/DEBUG: Revision: '0'
02-13 17:53:11.909 122-122/? I/DEBUG: ABI: 'arm'
02-13 17:53:11.909 122-122/? I/DEBUG: pid: 24807, tid: 25863, name: GLThread 1159 >>> com.protectfive.cocos2dx.sample <<<
02-13 17:53:11.910 122-122/? I/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20
02-13 17:53:11.939 122-122/? I/DEBUG: backtrace:
02-13 17:53:11.940 122-122/? I/DEBUG: #00 pc 00788130 /data/app/com.protectfive.cocos2dx.sample-1/lib/arm/libMyGame.so (cocos2d::GLProgram::reset()+48)
02-13 17:53:11.940 122-122/? I/DEBUG: #1 pc 00791948 /data/app/com.protectfive.cocos2dx.sample-1/lib/arm/libMyGame.so (cocos2d::GLProgramCache::reloadDefaultGLPrograms()+2652)
02-13 17:53:11.940 122-122/? I/DEBUG: #2 pc 0052d4e1 /data/app/com.protectfive.cocos2dx.sample-1/lib/arm/libMyGame.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit+184)

The following launches, the app is working fine.

On first launch, the app downloads an obb file (native Android Activity) from google play, and after validating the download, it starts the Cocos2dxActivity.

I'm compiling the project with the following Android.mk file:

APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char
APP_LDFLAGS := -latomic
APP_ABI := armeabi-v7a arm64-v8a x86
ifeq ($(NDK_DEBUG),1)
APP_CPPFLAGS += -DCOCOS2D_DEBUG=1
APP_OPTIM := debug
else
APP_CPPFLAGS += -DNDEBUG
APP_OPTIM := release
endif

How can I fix this problem? How can I find out what produces the crash?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions