Android native crash problem(creator 3.7.2)

Hi guys. We are preparing the game release this time. I desperately need help with my creator 3.7.2 android native crash.

This error is a problem with the Google Play Store pre-validation report. When I checked the video, the app turned off as soon as it started.

Has anyone solved a problem related to this? I can’t guess where the problem is. There was no problem when tested internally, and above all, the problem occurs only with this device out of 9 devices in the Google pre-validation report.

The name and version of the device causing the problem are as follows.

Generic Small Desktop (x86) (virtual machine)
1366x768
Android 12L(SDK 32)

The sdk and ndk versions we are currently using are as follows.

PROP_COMPILE_SDK_VERSION=33
PROP_MIN_SDK_VERSION=21
PROP_TARGET_SDK_VERSION=31
PROP_BUILD_TOOLS_VERSION=28.0.0
distributionUrl=https://services.gradle.org/distributions/gradle-6.5.1-all.zip
ANDROID_NDK : 21.4.7075529

Here’s what the logcat says:

05-23 21:44:48.522: E/ActivityControllerCore(723): stackTrace:
05-23 21:44:48.522: E/ActivityControllerCore(723): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-23 21:44:48.522: E/ActivityControllerCore(723): Build fingerprint: ‘Google/Small Desktop (x86)/SmallDesktop.x86:12/SE2B.220326.027/9241628:userdebug/dev-keys’
05-23 21:44:48.522: E/ActivityControllerCore(723): Revision: ‘0’
05-23 21:44:48.522: E/ActivityControllerCore(723): ABI: ‘x86_64’
05-23 21:44:48.522: E/ActivityControllerCore(723): Timestamp: 2023-05-23 21:44:42.573281399-0700
05-23 21:44:48.522: E/ActivityControllerCore(723): Process uptime: 16s
05-23 21:44:48.522: E/ActivityControllerCore(723): Cmdline: com.chamelio.magicraft
05-23 21:44:48.522: E/ActivityControllerCore(723): pid: 9827, tid: 9913, name: Thread-4 >>> com.chamelio.magicraft <<<
05-23 21:44:48.522: E/ActivityControllerCore(723): uid: 10165
05-23 21:44:48.522: E/ActivityControllerCore(723): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
05-23 21:44:48.522: E/ActivityControllerCore(723): Cause: null pointer dereference
05-23 21:44:48.522: E/ActivityControllerCore(723): rax 0000000000000001 rbx 0000782fe4e61510 rcx 0000782ed1a6e808 rdx 000000000000029a
05-23 21:44:48.522: E/ActivityControllerCore(723): r8 0000000000000000 r9 0000000000000000 r10 00001ca300002fa8 r11 0000000000000088
05-23 21:44:48.522: E/ActivityControllerCore(723): r12 0000782ed14b050f r13 0000782f84e3a620 r14 0000782ece6a2b30 r15 0000000000000000
05-23 21:44:48.522: E/ActivityControllerCore(723): rdi 0000782f94e23768 rsi 000000000000016e
05-23 21:44:48.522: E/ActivityControllerCore(723): rbp 0000782fb4e23c90 rsp 0000782ece6a2a60 rip 0000782ecfeeeb81
05-23 21:44:48.522: E/ActivityControllerCore(723): backtrace:
05-23 21:44:48.522: E/ActivityControllerCore(723): #00 pc 00000000002d6b81 /data/app/~~mYqJBEpYF7mD_zFYS93dcw==/com.chamelio.magicraft-JP3YdcEFNnuFSTyKJWlqgQ==/split_config.x86_64.apk!libcocos.so (BuildId: ddfe2f09f1ffe4981014e765cb98473f2987a1a1)
05-23 21:44:48.522: E/ActivityControllerCore(723): #01 pc 00000000002cc938 /data/app/~~mYqJBEpYF7mD_zFYS93dcw==/com.chamelio.magicraft-JP3YdcEFNnuFSTyKJWlqgQ==/split_config.x86_64.apk!libcocos.so (BuildId: ddfe2f09f1ffe4981014e765cb98473f2987a1a1)
05-23 21:44:48.522: E/ActivityControllerCore(723): #02 pc 00000000002db0f1 /data/app/~~mYqJBEpYF7mD_zFYS93dcw==/com.chamelio.magicraft-JP3YdcEFNnuFSTyKJWlqgQ==/split_config.x86_64.apk!libcocos.so (BuildId: ddfe2f09f1ffe4981014e765cb98473f2987a1a1)
05-23 21:44:48.522: E/ActivityControllerCore(723): #03 pc 000000000045ce3a /data/app/~~mYqJBEpYF7mD_zFYS93dcw==/com.chamelio.magicraft-JP3YdcEFNnuFSTyKJWlqgQ==/split_config.x86_64.apk!libcocos.so (BuildId: ddfe2f09f1ffe4981014e765cb98473f2987a1a1)
05-23 21:44:48.522: E/ActivityControllerCore(723): #04 pc 00000000002daa02 /data/app/~~mYqJBEpYF7mD_zFYS93dcw==/com.chamelio.magicraft-JP3YdcEFNnuFSTyKJWlqgQ==/split_config.x86_64.apk!libcocos.so (BuildId: ddfe2f09f1ffe4981014e765cb98473f2987a1a1)
05-23 21:44:48.522: E/ActivityControllerCore(723): #05 pc 00000000002da926 /data/app/~~mYqJBEpYF7mD_zFYS93dcw==/com.chamelio.magicraft-JP3YdcEFNnuFSTyKJWlqgQ==/split_config.x86_64.apk!libcocos.so (BuildId: ddfe2f09f1ffe4981014e765cb98473f2987a1a1)
05-23 21:44:48.522: E/ActivityControllerCore(723): #06 pc 000000000045cd1f /data/app/~~mYqJBEpYF7mD_zFYS93dcw==/com.chamelio.magicraft-JP3YdcEFNnuFSTyKJWlqgQ==/split_config.x86_64.apk!libcocos.so (BuildId: ddfe2f09f1ffe4981014e765cb98473f2987a1a1)
05-23 21:44:48.522: E/ActivityControllerCore(723): #07 pc 00000000000c753a /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+58) (BuildId: 573da7d038ebd4c0e2991c89d54d6017)
05-23 21:44:48.522: E/ActivityControllerCore(723): #08 pc 000000000005fcc7 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+55) (BuildId: 573da7d038ebd4c0e2991c89d54d6017)
05-23 21:44:48.522: E/ActivityControllerCore(723): Overriding default system behaviour: suppressing crash dialog and killing the process.

Can you try to get backtrace with debug mode ? The release version don’t tell much about the crash point

The biggest problem is this. I don’t even know what device this is. It is said that it is a device used for Google’s preliminary inspection, but there is no information about the device, so debugging is impossible. Do you know what kind of device this is?

I found a way to reproduce it. A problem arises when building any project in the following way.

As a result of checking, it is not a problem that occurs on mobile. First of all, I don’t know why Google does a pre-screening with the “Desktop” setting.

However, due to this, errors always occur in the pre-inspection report. Perhaps other users have the same issue.

Could you debug your game in Android Studio and see which line causes the crash?

You also need to provide the steps for us to reproduce this issue.

I just built an empty project containing hello world. In any project, an error occurs in the desktop emulator described.

This crash occurs after the app launches and before the splash screen comes out.

@pandamicro @dumganhar

Maybe it’s a problem with my target sdk or build settings. If you succeed when you build with the same empty project, please share the development environment.

Have you enabled X86 architecture for desktop Android build ?
Google Play now supports PC and they have emulator on PC too, so for those kind of devices, you need to include X86 architecture

This is a screenshot of my build settings. x86 is included. An error occurs though.

Doesn’t an error occur when you test in the same environment?

스크린샷 2023-06-07 오후 3.04.23

Thanks for the information, I will try to reproduce the crash issue on my machine.
An issue was created for this thread: Crash on Android Emulator · Issue #15366 · cocos/cocos-engine · GitHub

So did you find this issue on the Android Emulator running on mac platform?
What’s the name of your mac device and what’s its OS version?

This is a bug which was fixed at 3.7.3, you could refer to Fix the crash problem of android platform caused by windowId being 0 by bofeng-song · Pull Request #14670 · cocos/cocos-engine · GitHub and try to apply that patch to test.

1 Like

i get it. I’ll try upgrading the engine. thanks for letting me know.

After updating the engine, the problem was completely resolved. thanks!

Great.

@dumganhar

hello friend. We changed the target sdk to 33 this time, but the same error occurs. Of course, the Cocos Creator version that occurred this time is 3.7.3. Is there a way to solve the error that occurred in version 3.7.3?

Got it. I will test it with target sdk 33 and try to figure out.

Which API level of the virtual device are you using? I could not reproduce it on the virtual device with API level 32 and I built the APK with Target SDK Version 33.

@dumganhar
hello friend. We did an update on the Play Store today, tested on the same device and in the same environment, and no errors occurred. Maybe the error doesn’t occur in all situations. If the error occurs again later, I will leave an additional update. The device causing the error was an API Level 32 Small Desktop.