libgdx game crashes on some devices

廉价感情. 提交于 2019-12-04 23:54:16
bozzmob

The function "JNI_OnLoad" is not essential for an android app. It is not even an error. Your problem is from another part of your code. Even if you have not provided this function, your program should run normally.

References on JNI_OnLoad which can be helpful - Link 1 | Link 2 | Link 3

There is a way to fix it though-

Try to use ndk-gdb to fix it.

References for ndk-gdb - developer.android.com | Stackoverflow

I do have this issue in like most of the projects I have worked on. It is nothing related to Android app getting crashed.

There is something else in your app that is crashing. Some tips to consider which will help you debug-

  1. Check Playstore(if its on playstore) for logs(what exactly the error is). They give stack trace which helps to debug.

  2. If its not on Playstore, only way to go forward is to do remote debug on the mobile which is giving the error.

  3. I have had such experiences, and its MOST OF THE TIME because of API change. What I mean is, APIs would have changed from one Android version to another(Kitkat to Lollipop - there are lots of breaking changes!) Check this once. Most of my apps had lots of issues because of this.

  4. Some mobile's are strict when it comes to DB(sqlite or whatever you use on the phone) transactions. I mean, in one of the application, when the DB was not closed at the end of all transactions, the app was getting Force closed in most Samsung & HTC mobile phones. While it worked very well on most other phones.

Hope it helps :) Happy coding!

Note to self: "Always use asset manager and texture atlases"

Over the course of developing I eventually replaced all textures with texture atlases and combined with asset manager. I didn't change any logic at all. Somehow the app stopped crashing. Can't explain it but I thing the asset manager and texture atlases did the trick.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!