Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.8.2] Android WebSocket 崩溃 [Java_com_cocos_lib_websocket_CocosWebSocket_nativeOnError] #18324

Open
TorrentialNight opened this issue Feb 13, 2025 · 11 comments
Labels
Bug Needs Triage Needs to be assigned by the team

Comments

@TorrentialNight
Copy link

Cocos Creator version

3.8.2

System information

android机

Issue description

split_config.arm64_v8a.apk!libcocos.so
Google backend crash analysis:
Java_com_cocos_lib_websocket_CocosWebSocket_nativeOnError,Java_com_cocos_lib_CocosAudioFocusManager_nativeSetAudioVolumeFactor
The collapse rate is very high, It has affected the online data of Google applications
this #14730
At present, version 3.8.2 seems to have encountered this issue again

Relevant error log output


pid: 0, tid: 21665 >>>packagename <<<

backtrace:
#00 pc 0x00000000005f4fa4 /data/app/~~DpliaYxr5qata55ZYDXeGA==/packagename-rEm0Biy3yli6L8Kpp8rnRA==/split_config.arm64_v8a.apk!libcocos.so (BuildId: 64e11e7ffef09019b52165ffdc5df30e572c7b46)
#1 pc 0x000000000072dc80 /data/app/~~DpliaYxr5qata55ZYDXeGA==/packagename-rEm0Biy3yli6L8Kpp8rnRA==/split_config.arm64_v8a.apk!libcocos.so (BuildId: 64e11e7ffef09019b52165ffdc5df30e572c7b46)
#2 pc 0x000000000029e700 /data/app/~~DpliaYxr5qata55ZYDXeGA==/packagename-rEm0Biy3yli6L8Kpp8rnRA==/split_config.arm64_v8a.apk!libcocos.so (BuildId: 64e11e7ffef09019b52165ffdc5df30e572c7b46)
#3 pc 0x00000000005efbdc /data/app/~~DpliaYxr5qata55ZYDXeGA==/packagename-rEm0Biy3yli6L8Kpp8rnRA==/split_config.arm64_v8a.apk!libcocos.so (BuildId: 64e11e7ffef09019b52165ffdc5df30e572c7b46)
#4 pc 0x00000000002fd5fc /data/app/~~DpliaYxr5qata55ZYDXeGA==/packagename-rEm0Biy3yli6L8Kpp8rnRA==/split_config.arm64_v8a.apk!libcocos.so (BuildId: 64e11e7ffef09019b52165ffdc5df30e572c7b46)
#5 pc 0x000000000000f824 /data/app/~~DpliaYxr5qata55ZYDXeGA==/packagename-rEm0Biy3yli6L8Kpp8rnRA==/split_config.arm64_v8a.apk

Steps to reproduce

It has not been reproduced, and it is speculated that the direction may be due to the long background time of cocos activity after clicking on the advertisement, which caused the connection to be interrupted

Minimal reproduction project

No response

@TorrentialNight TorrentialNight added Bug Needs Triage Needs to be assigned by the team labels Feb 13, 2025
@TorrentialNight
Copy link
Author

TorrentialNight commented Feb 14, 2025

I tested some models yesterday and clicking on in-game ads did not turn them off. After 5 minutes, I did not notice any crashes, so I am temporarily unable to reproduce these crash errors

@dumganhar
Copy link
Contributor

Try to merge the latest two commits for WebSocket-okhttp.cpp file.

https://github.com/cocos/cocos-engine/commits/3.8.5/native/cocos/network/WebSocket-okhttp.cpp

@TorrentialNight
Copy link
Author

Thank you. After reviewing the latest update instructions in 3.8.6 that you mentioned, it seems that the relevant bugs have been fixed. I have replaced the relevant files and repackaged them for testing. I will submit them to the Google Play Store for further review in the next few days

@TorrentialNight
Copy link
Author


pid: 0, tid: 17857 >>> com.capetown.ccgcapetown.gb.gp <<<

backtrace:
#00 pc 0x00000000003cd184 /data/app/~~CFdGclhSN04fpTcaHu5khw==/com.capetown.ccgcapetown.gb.gp-83JWXPLXEbc2bVqvNh2igQ==/split_config.arm64_v8a.apk!libcocos.so (BuildId: 56f2c1c4ee91b1bced492d0d611f5dc13a648860)
#1 pc 0x00000000003cd218 /data/app/~~CFdGclhSN04fpTcaHu5khw==/com.capetown.ccgcapetown.gb.gp-83JWXPLXEbc2bVqvNh2igQ==/split_config.arm64_v8a.apk!libcocos.so (BuildId: 56f2c1c4ee91b1bced492d0d611f5dc13a648860)
#2 pc 0x00000000003cd218 /data/app/~~CFdGclhSN04fpTcaHu5khw==/com.capetown.ccgcapetown.gb.gp-83JWXPLXEbc2bVqvNh2igQ==/split_config.arm64_v8a.apk!libcocos.so (BuildId: 56f2c1c4ee91b1bced492d0d611f5dc13a648860)
#3 pc 0x00000000003cd218 /data/app/~~CFdGclhSN04fpTcaHu5khw==/com.capetown.ccgcapetown.gb.gp-83JWXPLXEbc2bVqvNh2igQ==/split_config.arm64_v8a.apk!libcocos.so (BuildId: 56f2c1c4ee91b1bced492d0d611f5dc13a648860)
#4 pc 0x00000000003cd218 /data/app/~~CFdGclhSN04fpTcaHu5khw==/com.capetown.ccgcapetown.gb.gp-83JWXPLXEbc2bVqvNh2igQ==/split_config.arm64_v8a.apk!libcocos.so (BuildId: 56f2c1c4ee91b1bced492d0d611f5dc13a648860)
#5 pc 0x00000000003cc9e4 /data/app/~~CFdGclhSN04fpTcaHu5khw==/com.capetown.ccgcapetown.gb.gp-83JWXPLXEbc2bVqvNh2igQ==/split_config.arm64_v8a.apk!libcocos.so (BuildId: 56f2c1c4ee91b1bced492d0d611f5dc13a648860)
#6 pc 0x00000000003cdd8c /data/app/~~CFdGclhSN04fpTcaHu5khw==/com.capetown.ccgcapetown.gb.gp-83JWXPLXEbc2bVqvNh2igQ==/split_config.arm64_v8a.apk!libcocos.so (BuildId: 56f2c1c4ee91b1bced492d0d611f5dc13a648860)
#7 pc 0x000000000028e66c /data/app/~~CFdGclhSN04fpTcaHu5khw==/com.capetown.ccgcapetown.gb.gp-83JWXPLXEbc2bVqvNh2igQ==/split_config.arm64_v8a.apk!libcocos.so (BuildId: 56f2c1c4ee91b1bced492d0d611f5dc13a648860)
#8 pc 0x00000000004d49b0 /data/app/~~CFdGclhSN04fpTcaHu5khw==/com.capetown.ccgcapetown.gb.gp-83JWXPLXEbc2bVqvNh2igQ==/split_config.arm64_v8a.apk!libcocos.so (BuildId: 56f2c1c4ee91b1bced492d0d611f5d

I merged the two latest versions of the files over the past week, but the problem still hasn't been resolved

@dumganhar
Copy link
Contributor

@TorrentialNight , you may need one more patch: #18351 because #17609 break something.

@TorrentialNight
Copy link
Author

@dumganhar I replaced the file on # 18351 on top of the two okhttp files that have already been replaced, right

@TorrentialNight
Copy link
Author

@dumganhar The current version is 3.8.2, Is there a problem with directly replacing the files mentioned in # 18351

@dumganhar
Copy link
Contributor

I think you could replace this 3 files from https://github.com/dumganhar/cocos-engine/tree/386-fix-websocket-crash

native/cocos/network/WebSocket-okhttp.cpp
native/cocos/platform/android/java/src/com/cocos/lib/websocket/CocosWebSocket.java
native/cocos/bindings/manual/jsb_websocket.cpp

and cherrypick changes in Engine.h/.cpp in my PR #18351

@TorrentialNight
Copy link
Author

Thank you, I will give it a try and upload it to the Google Play store to continue trying

@dumganhar
Copy link
Contributor

@TorrentialNight Any results?

@TorrentialNight
Copy link
Author

@dumganhar Not yet ,we are preparing game updates which may take some time. Once we have the results on the Google Play Store, we will update you promptly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Needs to be assigned by the team
Projects
None yet
Development

No branches or pull requests

2 participants