3.3.2打包安卓运行闪崩

  • Creator 版本: cocos creator3.3.2
  • 目标平台:Android
  • 重现方式:

1 .构建安卓项目后,使用Android studio ,打开了proj项目。
2 .项目使用gradle 。
3 . Android studio2020.3.1beta 。 ndk版本:21.1,java版本是1.8,安卓编译版本26
sdk tools版本30.0.3

启动后的log

11/19 17:56:42: Launching ‘gangWar’ on Pixel_3a_API_31_arm64-v8a.
Install successfully finished in 1 s 363 ms.
$ adb shell am start -n “com.cocosgame.gangwar/com.cocos.game.AppActivity” -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 6170 on device ‘Pixel_3a_API_31_arm64-v8a [emulator-5554]’.
Capturing and displaying logcat messages from application. This behavior can be disabled in the “Logcat output” section of the “Debugger” settings page.
D/CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10147; state: DISABLED
D/ApplicationLoaders: Returning zygote-cached class loader: /system/framework/android.test.base.jar
V/GraphicsEnvironment: ANGLE Developer option for ‘com.cocosgame.gangwar’ set to: ‘default’
Neither updatable production driver nor prerelease driver is supported.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/libEGL: loaded /vendor/lib64/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib64/egl/libGLESv2_emulation.so
I/CocosActivity JNI: APP_CMD_RESUME
appState=11
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0x6f118dddd0, tid 6217
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
I/CocosActivity JNI: APP_CMD_INIT_WINDOW
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without…
W/OpenGLRenderer: Failed to initialize 101010-2 format, error = EGL_SUCCESS
D/EGL_emulation: eglCreateContext: 0x6f118de3d0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0x6f118de3d0: ver 3 0 (tinfo 0x712fd38080) (first time)
I/Gralloc4: mapper 4.x is not supported
D/jswrapper: Initializing V8, version: 8.0.426.16
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0x6f118ded90, tid 6217
D/goldfish-address-space: allocate: Ask for block of size 0x100
allocate: ioctl allocate returned offset 0x1f3ff8000 size 0x8000
W/Gralloc4: allocator 4.x is not supported
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
D/jswrapper: libuv version: 1.13.1
W/cosgame.gangwar: type=1400 audit(0.0:36): avc: granted { bind } for scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:r:untrusted_app_27:s0:c512,c768 tclass=netlink_route_socket app=com.cocosgame.gangwar
type=1400 audit(0.0:37): avc: granted { nlmsg_readpriv } for scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:r:untrusted_app_27:s0:c512,c768 tclass=netlink_route_socket app=com.cocosgame.gangwar
D/jswrapper: Debugger listening…, visit [
devtools://devtools/bundled/js_app.html?v8only=true&ws=10.0.2.16:6086/00010002-0003-4004-8005-000600070008
devtools://devtools/bundled/js_app.html?v8only=true&ws=10.0.2.15:6086/00010002-0003-4004-8005-000600070008
devtools://devtools/bundled/js_app.html?v8only=true&ws=127.0.0.1:6086/00010002-0003-4004-8005-000600070008
D/jswrapper: ] in chrome browser to debug!
For help see https://nodejs.org/en/docs/inspector
D/jswrapper: JS: [INFO]: [PHYSICS]: register builtin.
W/cosgame.gangwa: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (unsupported,core-platform-api, reflection, allowed)
Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (unsupported,core-platform-api, reflection, allowed)
Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (unsupported,core-platform-api, reflection, allowed)
D/Cocos: 01:56:45 [DEBUG]: find in flash memory dirPath(/data/user/0/com.cocosgame.gangwar/files/temp)
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0x6f118de250, tid 6222
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
I/Cocos: 01:56:45 [INFO]: Setup EGLConfig: depth [24] stencil [8] sampleBuffer [0] sampleCount [0]
01:56:45 [INFO]: Chosen EGLConfig: color [RGBA8], depth stencil [D24S8].
E/EGL_emulation: eglCreateContext: EGL_BAD_CONFIG: no ES 3.2 support
tid 6222: eglCreateContext(1849): error 0x3005 (EGL_BAD_CONFIG)
E/Cocos: 01:56:45 [ERROR]: [ERROR] file /Applications/CocosCreator/Creator/3.3.2/CocosCreator.app/Contents/Resources/resources/3d/engine-native/cocos/renderer/gfx-gles3/GLES3Context.cpp: line 324
01:56:45 [ERROR]: _eglContext = eglCreateContext(_eglDisplay, _eglConfig, nullptr, ctxAttribs) returned EGL error: 0x3005
E/assert: /Applications/CocosCreator/Creator/3.3.2/CocosCreator.app/Contents/Resources/resources/3d/engine-native/cocos/renderer/gfx-gles3/GLES3Context.cpp function:doInit line:324
E/EGL_emulation: eglCreateContext: EGL_BAD_CONFIG: no ES 3.1 support
tid 6222: eglCreateContext(1843): error 0x3005 (EGL_BAD_CONFIG)
E/Cocos: 01:56:45 [ERROR]: [ERROR] file /Applications/CocosCreator/Creator/3.3.2/CocosCreator.app/Contents/Resources/resources/3d/engine-native/cocos/renderer/gfx-gles3/GLES3Context.cpp: line 324
01:56:45 [ERROR]: _eglContext = eglCreateContext(_eglDisplay, _eglConfig, nullptr, ctxAttribs) returned EGL error: 0x3005
E/assert: /Applications/CocosCreator/Creator/3.3.2/CocosCreator.app/Contents/Resources/resources/3d/engine-native/cocos/renderer/gfx-gles3/GLES3Context.cpp function:doInit line:324
D/EGL_emulation: eglCreateContext: 0x6f118de790: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0x6f118de790: ver 3 0 (tinfo 0x712fd38100) (first time)
E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glBindTexture:2430 GL error 0x500 condition [!GLESv2Validation::textureTarget(ctx, target)]
E/Cocos: 01:56:45 [ERROR]: [ERROR] file /Applications/CocosCreator/Creator/3.3.2/CocosCreator.app/Contents/Resources/resources/3d/engine-native/cocos/renderer/gfx-gles3/GLES3Context.cpp: line 598
01:56:45 [ERROR]: glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, 0) returned GL error: 0x500
E/assert: /Applications/CocosCreator/Creator/3.3.2/CocosCreator.app/Contents/Resources/resources/3d/engine-native/cocos/renderer/gfx-gles3/GLES3Context.cpp function:makeCurrent line:598
D/Cocos: 01:56:45 [DEBUG]: eglMakeCurrent() - SUCCEEDED, Context: 0x0x6e1220ec00
I/Cocos: 01:56:45 [INFO]: GLES3 device initialized.
I/Cocos: 01:56:45 [INFO]: RENDERER: Android Emulator OpenGL ES Translator (Apple M1)
01:56:45 [INFO]: VENDOR: Google (Apple)
01:56:45 [INFO]: VERSION: OpenGL ES 3.0 (4.1 Metal - 71.7.1)
01:56:45 [INFO]: SCREEN_SIZE: 1080 x 2220
01:56:45 [INFO]: COMPRESSED_FORMATS: etc1 etc2 astc
01:56:45 [INFO]: PIXEL_LOCAL_STORAGE: level 0, size 0
01:56:45 [INFO]: FRAMEBUFFER_FETCH: NONE
D/Cocos: 01:56:45 [DEBUG]: eglMakeCurrent() - UNBOUNDED, Context: 0x0x6e1220ec00
I/Cocos: 01:56:45 [INFO]: Device validator enabled.
D/jswrapper: JS: [INFO]: [PHYSICS]: using builtin.
D/HostConnection: createUnique: call
HostConnection::get() New Host Connection established 0x6f118de010, tid 6245
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
D/EGL_emulation: eglCreateContext: 0x6f118df090: maj 3 min 0 rcv 3
eglMakeCurrent: 0x6f118df090: ver 3 0 (tinfo 0x712fd38180) (first time)
E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glBindTexture:2430 GL error 0x500 condition [!GLESv2Validation::textureTarget(ctx, target)]
E/Cocos: 01:56:45 [ERROR]: [ERROR] file /Applications/CocosCreator/Creator/3.3.2/CocosCreator.app/Contents/Resources/resources/3d/engine-native/cocos/renderer/gfx-gles3/GLES3Context.cpp: line 598
01:56:45 [ERROR]: glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, 0) returned GL error: 0x500
E/assert: /Applications/CocosCreator/Creator/3.3.2/CocosCreator.app/Contents/Resources/resources/3d/engine-native/cocos/renderer/gfx-gles3/GLES3Context.cpp function:makeCurrent line:598
D/Cocos: 01:56:45 [DEBUG]: eglMakeCurrent() - SUCCEEDED, Context: 0x0x6cf9f97f60
I/Cocos: 01:56:45 [INFO]: Device thread detached.
I/Cocos: 01:56:45 [INFO]: Shader ‘splash-screen|splash-screen-vs:vert|splash-screen-fs:frag’ compilation succeeded.

报错的红字部分:

E/EGL_emulation: eglCreateContext: EGL_BAD_CONFIG: no ES 3.2 support
tid 6222: eglCreateContext(1849): error 0x3005 (EGL_BAD_CONFIG)
E/Cocos: 01:56:45 [ERROR]: [ERROR] file /Applications/CocosCreator/Creator/3.3.2/CocosCreator.app/Contents/Resources/resources/3d/engine-native/cocos/renderer/gfx-gles3/GLES3Context.cpp: line 324
01:56:45 [ERROR]: _eglContext = eglCreateContext(_eglDisplay, _eglConfig, nullptr, ctxAttribs) returned EGL error: 0x3005
E/assert: /Applications/CocosCreator/Creator/3.3.2/CocosCreator.app/Contents/Resources/resources/3d/engine-native/cocos/renderer/gfx-gles3/GLES3Context.cpp function:doInit line:324
E/EGL_emulation: eglCreateContext: EGL_BAD_CONFIG: no ES 3.1 support
tid 6222: eglCreateContext(1843): error 0x3005 (EGL_BAD_CONFIG)
E/Cocos: 01:56:45 [ERROR]: [ERROR] file /Applications/CocosCreator/Creator/3.3.2/CocosCreator.app/Contents/Resources/resources/3d/engine-native/cocos/renderer/gfx-gles3/GLES3Context.cpp: line 324
01:56:45 [ERROR]: _eglContext = eglCreateContext(_eglDisplay, _eglConfig, nullptr, ctxAttribs) returned EGL error: 0x3005
E/assert: /Applications/CocosCreator/Creator/3.3.2/CocosCreator.app/Contents/Resources/resources/3d/engine-native/cocos/renderer/gfx-gles3/GLES3Context.cpp function:doInit line:324

系统mac m1

用的AS自带的模拟器

官方helloworld项目,用这个环境打包也运行不了,来个人关注一下吧 @jare

我也是 求解决

看你这现象描述感觉是cpu架构不兼容,查查你打的包是arm64的吗

我构建的时候都勾了

先不要用你的项目测试,先用官方的HELLOWORLD测试看

是用的helloworld

或者这样 用245COCOS的试试,先不要用3.X的

245构建的工程是不是不能用as2020.3.1打开,as里直接不能build了

可以用 我现在用的就是你说的这些环境 ,完全一致 没问题

报错在这呢:EGL_BAD_CONFIG

tid 6222: eglCreateContext(1849): error 0x3005 (EGL_BAD_CONFIG)
E/Cocos: 01:56:45 [ERROR]: [ERROR] file /Applications/CocosCreator/Creator/3.3.2/CocosCreator.app/Contents/Resources/resources/3d/engine-native/cocos/renderer/gfx-gles3/GLES3Context.cpp: line 324
01:56:45 [ERROR]: _eglContext = eglCreateContext(_eglDisplay, _eglConfig, nullptr, ctxAttribs) returned EGL error: 0x3005
E/assert: /Applications/CocosCreator/Creator/3.3.2/CocosCreator.app/Contents/Resources/resources/3d/engine-native/cocos/renderer/gfx-gles3/GLES3Context.cpp function:doInit line:324

安卓可真让人抓狂,ios就顺顺利利的:weary:

是不是你手机太老了,vulkan不支持之后,手机尝试切换opengl es3.2,结果手机还不支持,然后又换到3.1还是不行。
建议换个新手机试试

用的AS的模拟器

模拟器同理啊,建议先用手机跑通再折腾模拟器

构建安卓的app abi全勾上了,解决

AS自带模拟器一般只支持gles2,换个渲染后端试试。

构建安卓的app abi全勾上了,解决

这个不大可能是真实的解决办法,试试去掉会不会复现?