-
Notifications
You must be signed in to change notification settings - Fork 2k
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.6.3] Android WebSocket Crash [Java_com_cocos_lib_websocket_CocosWebSocket_nativeOnClosed] #14730
Comments
我们曾经尝试过修改 CocosWebSocket.java 里面的超时时间设置,但是修改上线后,问题依旧存在,以下为我们最新的改动 修改了以下3个超时设置
新增了
|
@mmyduckx please take a look. If i remember correctly, it is fixed in upper version. |
刚刚去GooglePlay后台在看了一下,还有其他类似的错误
|
我们这边游戏接入了聚合广告,以上的崩溃日志,在GooglePlay后台上,大概6成左右是在后台时发生(但是还是有相当一部分在前台发生) 我们猜测和用户跳转到广告播放有关系,提供一些想法,不知道是否可以
|
Thanks, please use english in future. |
Have you started to follow up on this issue? We're really looking forward to some feedback, anything is fine |
@mmyduckx please take a look. |
@zhitaocai Try this patch and keep record. diff --git a/native/cocos/engine/Engine.cpp b/native/cocos/engine/Engine.cpp
index c0636c3d49..5b738aa076 100644
--- a/native/cocos/engine/Engine.cpp
+++ b/native/cocos/engine/Engine.cpp
@@ -187,6 +187,10 @@ void Engine::destroy() {
#if CC_USE_MIDDLEWARE
cc::middleware::MiddlewareManager::destroyInstance();
#endif
+
+#if CC_USE_SOCKET
+ cc::network::WebSocket::closeAllConnections();
+#endif
CCObject::deferredDestroy();
|
Received, thanks for the reply~, we will arrange the test immediately |
Please let us know if it works, as we don't have a reproducible demo that you state above :) |
At present, we have not found any major problems in our self-test. It seems that we still need to run it online on a large scale. We are currently expecting to bring it to GooglePlay this Friday |
If the GooglePlay review goes well, we expect to get the results next week, and we will come back and update the results of this issue at that time |
Thanks for your cooperation!
Thanks for your cooperation! |
The review has passed, and we are distributing the new version on a small scale. At present, the amount of data is relatively small, but similar crash information still exists. In particular, in this version, in addition to making modifications according to the suggestions provided, we also upgraded the engine version from 3.6.3 to 3.7.1, but similar errors still exist. The following is the latest crash information:
|
Got it. We will investigate further. |
yes, still have |
Just now I also found a new crash information that may be related to this problem, I hope it will help to solve this problem
|
Received, I will continue to follow up on this issue |
Hello, is there any good news on this issue, we are looking forward to it |
Not yet. Expect progress this week |
diff --git a/native/cocos/network/WebSocket-okhttp.cpp b/native/cocos/network/WebSocket-okhttp.cpp
index 6cdfc93547..4fe86d5607 100644
--- a/native/cocos/network/WebSocket-okhttp.cpp
+++ b/native/cocos/network/WebSocket-okhttp.cpp
@@ -350,10 +350,14 @@ extern "C" {
#endif
#define JNI_PATH(methodName) Java_com_cocos_lib_websocket_CocosWebSocket_##methodName
-#define RUN_IN_GAMETHREAD(task) \
- CC_CURRENT_ENGINE()->getScheduler()->performFunctionInCocosThread([=]() { \
- task; \
- })
+#define RUN_IN_GAMETHREAD(task) \
+ do { \
+ if (CC_CURRENT_APPLICATION()) { \
+ CC_CURRENT_ENGINE()->getScheduler()->performFunctionInCocosThread([=]() { \
+ task; \
+ }); \
+ } \
+ } while (0)
JNIEXPORT void JNICALL JNI_PATH(NativeInit)(JNIEnv * /*env*/, jclass /*clazz*/) {
// nop Hi, just try this patch!(Don't need above patch anymore) |
Thanks for providing the patch. The May Day holiday is approaching, we may have to submit it to GooglePlay for review after the holiday~ |
Happy holidays, looking forward to your progress |
Here's an update on our progress: The latest patch, we expect to submit it to GooglePlay for review on May 12 |
Thanks for your reply. Got it. |
Here's an update on our progress: Our version with the latest patches is still under GooglePlay review |
Our new version has been approved. Currently in a small amount of distribution, it seems that the above crash information is gone. We expect to slowly increase the amount in these two days, and observe for a weekend. There may be a clear conclusion next Monday. Thanks for the support from the engine team~ |
You're welcome! |
After several days of observation, we have confirmed that this type of crash has been fixed, and this Issue can be closed. Thanks again for the support of the engine team. |
Good to here that. |
Thanks for your feedback and support for cocos engine. We have submitted the fix to 3.8.0; if there are still problems in future, please let us know. |
Cocos Creator version
3.6.3
System information
Android 10, Android 11, Android 12, Android 13
Issue description
我们最近采用了 3.6.3 版本的 Cocos Creator 做了一款游戏,用到了 WebSocket,在我们发布到 Google Play 后,发现线上应用出现大量的崩溃信息,关键信息为
Java_com_cocos_lib_websocket_CocosWebSocket_nativeOnClosed
Relevant error log output
Steps to reproduce
我们尝试了很多方法,自己的测试机子没法重现
Minimal reproduction project
没法重现
The text was updated successfully, but these errors were encountered: