libgdx game crashes on some devices - android

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?
Edit: 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: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

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-
Check Playstore(if its on playstore) for logs(what exactly the error is). They give stack trace which helps to debug.
If its not on Playstore, only way to go forward is to do remote debug on the mobile which is giving the error.
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.
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.

Related

Error - Android app causes UNKNOWN kind of performance degradation (weird Samsung issue)

Testing on Samsung Galaxy Note Edge, Android 6.0.1
PLEASE NOTE - this issue happens only on Samsung Phones with pre-installed "Smart Manager". If you have no experience with that constellation, please read in detail whats the real issue. This is irregular, not a usual debugging thing. Please don't expect a code snippet right now, there cant be one. At this point I cant post any reasonable line of code because the origin of those errors is COMPLETELY UNCLEAR. I have only 4500 lines, and 25 classes, but absolutely no clue where to pick a meaningful snippet from without any hint what Smart Manager complains concretely. It says just one word: "ERROR", but not when, not why, not what ... Mission Impossible 😩
I've researched a lot now, but found almost nothing being of help. My app is compiling fine without errors and running smoothly (and very fast!) as desired. I cant feel anything about "performance degradation", but Samsung "Smart Manager" has this very weird issue with my app...
Battery lasts for days on standby, no heat, nothing notably.
No information what kind of error should have been occurred at all. No more details to open, simply nothing!
My app does definitely not run in background. It stops, pauses and resumes without issues. No issues, no errors during building (Android Studio 2.2), no warnings about Smart Manager performance issues, this error pops up ONE WEEK LATER, or two or three. That's why I you have no chance to create a link between error and possible root cause to start tracking down. In that time you made lots of code changes before you get notified from SM the first time, lots of Git commits, but which one contains the change this external tool complains? That makes it a real hell.
I also let it connected for 5 days to USB, collecting tons of logs, crawling the logcat like crazy for any relevant events, but SAMSUNG's Smart Manager doesn't seem any need to log at least one word when it counts its ominous errors.
What I've found on the net, nobody really knows how to debug this, just very time-consuming guesses which I followed where applicable - without success.
What I've already tried:
Exceptions - all caught and handled
Removed all debug logging output
Checked for infinite loops
Checked for missing or damaged resource files
Disabled auto-translation
Checked for whatever could be irregular, suspicious or extraterrestrial 👽
And after making changes I must wait days or weeks if it will finally pop up again or not...
Could there be any way to catch those Smart Manager error count events and attach some whatever sort of logging to it? There is no documentation from Samsung anywhere, no support for this pre-installed app, no help at all.
The error message is very clear, 10 crashes in 1 week. I would clearly say that the app is sub standard.
You should start with implementing a Global Exceptional Handler or start using some specialized service such as "Crashlytics" in you App to understand what is going on.

Android - Unity3D freeze in splash screen on some phones

I have a problem with Unity3D. I created a game with Unity 4.6.2f1. My problem is, game crashes after splash screen(Like trying to open itself constantly). The weird part is, game works on my phones and my tablets perfectly. I have Nexus 5(With Android 5.1.1) , Iocean X7S(With Android 4.2.2) , PolyPad tablet(Android 4.2.2) , Teclast X98(Android 4.4.4). I had some beta testers which have LG G2 , Samsung S5660 , Sony Xperia Z3 , HTC M8. From these 4 phones only Samsung make it run while others failed. I first though that this is because display bits. So I unchecked 32 and 24 bits Display buffer. Same result. Then I triend to change forcing Open GL ES version. I tried to build it with "Automatic" section - I don't know if its failed or not but It started to fade to black after a time even in my devices so I guess It's not an option for fixing. Then I tried to force it to use Open GL ES 3.0 , failed again. Then I read in somewhere that my AdMob plugin might be the reason , so I removed the components of AdMob from scenes and deleted all AdMob Plugin files. Same result. Since the crashed phones are not under my control , Its really hard to detect real problem easily because I really need to beg to my friends for every test since my testers are my friends and they have their own personal life, according to them its more important than testing my game whole day. By the way , I would like to add this too , like a month ago , everything were alright. It was running normal on my friends phone(The one who has G2). I'm getting suspicious from signing the apk. Because before signing it , while I was sending it without sign , It was working. That might be wrong idea of course. I'm not an expert so Im here for your helps. I really would like to know why this is happening and I want to fix this. Thanks!
Okay , I found the solution. It turns out that one of my script was responsible for this problem. So I deleted it and rewrite another script that do the same job. I assume, script was trying to use RAM over and over , so because of that, Adreno 330 type processors try to block the App's Open GL for preventing phone from total crash. This is only assumption of course. But If you are having a problem like I had , especially in Adreno 330 processors, try to check your codes first for any overloading.
I have faced similar issues, sometimes the problem was the memory of the device, null reference etc. also you could try forcing Open GL ES 2.0
srry can't make comments

KeyError: 'ANDROID_APP_PATH'

I've been programming some Kivy/Python apps on my Motorola Moto G mobile phone.
I've got a few handy little apps, that have been working OK for a few months.
Today, I launched one of the apps - through the QPython interface, and it didn't work.
So, I tried another of my apps and that failed to launch for the same reason. In fact, all of them fail to launch for the same reason.
The error shown on screen ends with:
File "/QPython/core/build/python-install/lib/python2.7/UserDict.py", line 23, in getitem
KeyError: 'ANDROID_APP_PATH'
I presume that something on the phone has taken an upgrade - and broken something.
I assume that is the case because this problem affects all of the Kivy apps I was using.
Anyone else encountered this?
You need to have
#qpy:kivy
part in the first line.
At least that was what happened to me.
I suppose that is because QPython is finding what type of app is it.

How can I fix this unusual bug that is causing my android app to crash on certain phones?

I have recently completed development on a game for Android smartphones.
It was designed using the android 2.1 sdk and runs no problem on my test devices a 2.1 samsung galaxy europa and a 2.2 samsung galaxy tab and seems to run fine in the emulator for 2.3.3.
Up until recently it ran fine on my friends HTC desire S but suddenly it stopped working, crashing on start.
It would appear that the error is caused by a resource not being found.
This code has not been touched for the past 2 months and ran no problem on my 2.1 and 2.2 devices but I must have done something. It seems that suddenly that some phones can't see the resources but unfortunately I cannot replicate this bug and my friend is not around enough and is getting quite pissed at me for pestering him for me to take his phone and keep trying to fix it.
Any help would be much appreciated as this is driving me mad especially as I cannot replicate this bug with any of my equipment. I haven't even got a confirmation that it works on 2.3.3 as the people who have downloaded my app aren't leaving any useful feedback or submitting many error reports. Hopefully it is just a bug with HTC's variant of android.
I sometimes have errors like this when I'm rapidly iterating (tweak/test) on the emulator. They're usually solved by doing an "ant clean" and then recompiling. You could try cleaning and then doing a fresh build, installing it on your friends device, and then seeing if you still get the error.
-Kurtis
Have you considered/researched whether or not this actually is a resource problem...meaning does this resource actually exist in the folder Android is trying to draw from?
I'm currently facing the crash in a production application and have found the problem. This crash is only happening on HTC devices. Seems like HTC changed the core Android method that decode a Resource.
The documentation of BitmapFactory.decodeResource says :
Returns
The decoded bitmap, or null if the image could not be decode.
But HTC version of that crashes :(
In my case, I had mis-placed the "xml" folder. It was on the root of the project, but just moved within "/res" folder and the error was gone.

Android OsclNativeFile error: Seek lseek64 failed

I get the following error on my Android device:
E/OsclNativeFile( 1616): OsclNativeFile::Seek lseek64 failed
I want to know what it means, because I wasn't making anything special just getting a battery drain and the logcat show me zillion lines like the above. Thanks.
I got the same. That happened after i had updated my LG Optimus One P500 phone to android 2.3.3. I read this topic with no answers and was a bit disappointed. I tried to come back to 2.2, but phone didn't start (it stopped at android logo). I installed 2.3.3 again and it started normally. Then i experimented and soon noticed that there was no errors with sd-card unmounted. So I removed all programs from sd-card, and deleted all files from it (I moved it to laptop). And I have no such errors now. Maybe there is an easier way to solve it, but it has worked in my case.
The lseek64() system library function is typically used to access large files (2GB or greater). It's possible there's a flaw with the way the platform implements lseek64. A workaround--as tonixart has discovered--is to delete the large files on your sdcard.

Categories

Resources