libgdx游戏在某些设备上崩溃 [英] libgdx game crashes on some devices

查看:111
本文介绍了libgdx游戏在某些设备上崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

启动应用后,我的应用立即崩溃,而没有在设备上显示错误消息.这仅发生在Samsung Note 1(至少不能在所有设备上进行测试)上,而不会在Motorola Moto G或Galaxy s4mini上发生.我得到的唯一提示是在调试器中.我将其粘贴在下面.到底发生了什么,为什么它仅在某些设备上崩溃?

Right after start of app, my app crushes without error message on a device. This only happens on Samsung Note 1(at least, can't test on all devices), but not on Motorola Moto G or Galaxy s4mini. The only hint I get is in the debugger. I pasted it below. What exactly is happening and why it crashes only on some devices?

从正在运行的应用程序"菜单返回到应用程序时,它也会崩溃.注意1已安装CyanogenMod.也许这与崩溃有关.

it crashes also on return to the app from "running apps" menu. Note 1 has CyanogenMod installed. Maybe this has something to do with the crashing.

Edit2:另一个观察结果:注1仅将一半的内存分配为其他两个设备.这与崩溃有关吗?

Another observation: note 1 allocates only a half of the memory as the other two devices. Has this anything to do with the crash?

01-05 17:00:16.212 13486-13513/com.mygdx.myGame.android D/dalvikvm: Trying to load lib /data/app-lib/com.mygdx.myGame.android-2/libgdx-freetype.so 0x42441a58
    01-05 17:00:16.222 13486-13513/com.mygdx.myGame.android D/dalvikvm: Added shared lib /data/app-lib/com.mygdx.myGame.android-2/libgdx-freetype.so 0x42441a58
    01-05 17:00:16.222 13486-13513/com.mygdx.myGame.android D/dalvikvm: No JNI_OnLoad found in /data/app-lib/com.mygdx.myGame.android-2/libgdx-freetype.so 0x42441a58, skipping init

推荐答案

函数"JNI_OnLoad" 对于Android应用程序不是必不可少的.这甚至不是错误.您的问题来自代码的另一部分.即使您没有提供此功能,您的程序也应该可以正常运行.

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.

关于JNI_OnLoad的参考可能会有所帮助-链接1 | 链接2 | 链接3

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

有一种修复方式,它-

尝试使用 ndk-gdb 对其进行修复.

Try to use ndk-gdb to fix it.

ndk-gdb的参考- developer.android.com | Stackoverflow

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

就像我从事的大多数项目一样,我确实有这个问题.这与Android应用程序崩溃无关.

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. 检查Playstore(如果位于Playstore上)是否有日志(错误确切出在哪里).它们提供了堆栈跟踪,有助于调试.

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

如果它不在Playstore上,则前进的唯一方法是在出现错误的移动设备上进行远程调试.

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

我曾经有过这样的经历,而且由于API的更改,它的大部分时间都是这样.我的意思是,API将从一个Android版本更改为另一个版本(从Kitkat到Lollipop-有很多重大更改!)请检查一次.因此,我的大多数应用程序都有很多问题.

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.

对于DB(sqlite或您在电话上使用的任何内容)交易,某些移动电话非常严格.我的意思是,在其中一个应用程序中,当数据库未在所有事务结束时关闭时,该应用程序将在大多数三星电子和三星电子公司中强制关闭. HTC手机.虽然在其他大多数手机上效果很好.

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!

这篇关于libgdx游戏在某些设备上崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆