Loads of crashes! After migrating to Axmol, now I'm very worried! #2126
Replies: 4 comments 10 replies
-
The call to From the 3 phone models listed in the crash logs, only the
A similar issue is being tracked in #1211. You can try a few things: Option 1: Setting Option 2: Handle it the way Cocos2d-x v4 does, which is by commenting out
That is until we can figure out why this is happening. |
Beta Was this translation helpful? Give feedback.
-
@halx99 Is there any chance the value for
|
Beta Was this translation helpful? Give feedback.
-
I don't know if this is related, but there's one unfixed issue in Axmol when app activity is recreated, which also destroys and recreates OpenGL context. You can repro it by starting your app, then change global font size in Android's settings menu, and go back to your app. This is the patch to fix it, you could try it: From 220ff08dd46a3b2335b192a6b19997bf5673252c Mon Sep 17 00:00:00 2001
Date: Wed, 12 Jun 2024 19:19:49 +0300
Subject: [PATCH] Fix lost state in AxmolRenderer when app activity is
relaunched
---
.../java/src/org/axmol/lib/AxmolRenderer.java | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/core/platform/android/java/src/org/axmol/lib/AxmolRenderer.java b/core/platform/android/java/src/org/axmol/lib/AxmolRenderer.java
index 5b1c90030..f66677a08 100644
--- a/core/platform/android/java/src/org/axmol/lib/AxmolRenderer.java
+++ b/core/platform/android/java/src/org/axmol/lib/AxmolRenderer.java
@@ -46,8 +46,9 @@ public class AxmolRenderer implements GLSurfaceView.Renderer {
private long mLastTickInNanoSeconds;
private int mScreenWidth;
private int mScreenHeight;
- private boolean mNativeInitCompleted = false;
- private boolean mIsPaused = false;
+
+ private static boolean gNativeInitCompleted = false;
+ private static boolean gIsPaused = false;
// ===========================================================
// Constructors
@@ -75,11 +76,11 @@ public class AxmolRenderer implements GLSurfaceView.Renderer {
AxmolRenderer.nativeInit(this.mScreenWidth, this.mScreenHeight);
this.mLastTickInNanoSeconds = System.nanoTime();
- if (mNativeInitCompleted) {
+ if (gNativeInitCompleted) {
// This must be from an OpenGL context loss
nativeOnContextLost();
} else {
- mNativeInitCompleted = true;
+ gNativeInitCompleted = true;
}
}
@@ -161,17 +162,17 @@ public class AxmolRenderer implements GLSurfaceView.Renderer {
* onSurfaceCreated is invoked. Can not invoke any
* native method before onSurfaceCreated is invoked
*/
- if (!mNativeInitCompleted)
+ if (!gNativeInitCompleted)
return;
AxmolRenderer.nativeOnPause();
- mIsPaused = true;
+ gIsPaused = true;
}
public void handleOnResume() {
- if (mIsPaused) {
+ if (gIsPaused) {
AxmolRenderer.nativeOnResume();
- mIsPaused = false;
+ gIsPaused = false;
}
}
-- |
Beta Was this translation helpful? Give feedback.
-
Just an update. I tried to test this issue, and managed to reproduce it very easily. Firstly, set the following to
In this specific instance, what crashed the app consistently on recovery from the context loss is a 999x54 sized texture which is added in
The crash always happened with this call in
This was due to the Change the pixel format used in the call to From: To one of the following: The crash never happened after that. Tracing it through, the correct Note that ALL resources that exist on disk were loaded correctly, since their pixel format is always set to the correct value. At no point could I get it to crash on reloading over 500MB of textures from disk after fixing the FPS texture pixel format. @meehjeevan I'm not sure if this is what is causing the crash that you are seeing, but if you want to test it out, set
This will no longer create the texture that is causing the problem. If this doesn't fix the issue for you, then you can test your own app to find exactly which cached texture is causing the problem by setting this PR #2138 has the fix for this specific issue. UPDATE: This issue had nothing to do with the FPS texture pixel format, but rather something else down the line that was affecting it. This has been resolved in the PR linked above. |
Beta Was this translation helpful? Give feedback.
-
I migrated my game from Cocos2d-x 3.17.2 and published an update on Google Play 1.5 months ago. I rolled it out to 5% of users for 3 weeks. A lot of crashes are showing up in the Play Console crash reports. I was already facing crash issues in the earlier version, and with Axmol, I encountered many crashes of new types.
I’m really worried. I used the latest version from the dev channel on GitHub 2 months ago.
Is the release v2.1.5 stable?
How can I get rid of these kind of crashes?
Please see below the an example of stack trace from play console mostly my app is getting :
I have attached full crash details in txt file also.
crashes_stack_trace.txt
Beta Was this translation helpful? Give feedback.
All reactions