I’m looking for some pointers here, the code runs perfectly in iOS. But in Android, at random points, the screen stops refreshing and the application seems to be frozen. It is actually running, no exceptions thrown. After adding some logging, I found out that the method public void onDrawFrame(GL10 gl) stops being called, which stops all CCDirector and Cocos activity.
Yes, it happens every time. It may happen after 1 minute or 10 minutes. There must be some event triggering this behavior. I tried on different Android phones and they all show the same issue. Again, the app doesn’t crash, it looks as the glsurface is not getting any onDrawFrame() callbacks anymore. Please, let me know what additional info I can help you with.
No, I decided to redesign the game and rewrite from scartch. But since I’m waiting for a stable c2d-x it’s being held off and I’m just trying to make myself write some planning and design.
Basically what I’d do, make everything placeholders w/ no sprites and see if it still crashes. If it does make some breakpoints and add some debug logs.
It is strange, because many games have been released on android, and no one has reported this bug.
Could you tell me the environment, the sdk version, the android phone, cocos2d-x version.
BTW, could you please run the ndk sample “san-angeles”, and check if it has the same issue?