I'm facing a weird issue where I am occasionally getting a StackOverflowError on calling SharedPreferences.Editor.Commit(). Problem occurs only sometimes and on Emulator only. If I rerun the app and call commit for the same value - everything is fine.
Seems rather random, and not something I ever saw on a physical device with the same code base. Seeing this on Pixel 3 API 29 Emulator image. Wondering if its an emulator issue.
Would like to know the cause for this error coming up randomly and what should be done about it?
Exception stack trace:
E/AndroidRuntime: FATAL EXCEPTION: Thread-19
java.lang.StackOverflowError: stack size 1040KB
at java.lang.String.getChars(String.java:787)
at com.android.internal.util.FastXmlSerializer.append(FastXmlSerializer.java:115)
at com.android.internal.util.FastXmlSerializer.append(FastXmlSerializer.java:139)
at com.android.internal.util.FastXmlSerializer.escapeAndAppendString(FastXmlSerializer.java:163)
at com.android.internal.util.FastXmlSerializer.text(FastXmlSerializer.java:413)
at com.android.internal.util.XmlUtils.writeValueXml(XmlUtils.java:662)
at com.android.internal.util.XmlUtils.writeMapXml(XmlUtils.java:307)
at com.android.internal.util.XmlUtils.writeMapXml(XmlUtils.java:276)
at com.android.internal.util.XmlUtils.writeMapXml(XmlUtils.java:242)
at com.android.internal.util.XmlUtils.writeMapXml(XmlUtils.java:199)
at android.app.SharedPreferencesImpl.writeToFile(SharedPreferencesImpl.java:778)
at android.app.SharedPreferencesImpl.access$900(SharedPreferencesImpl.java:55)
at android.app.SharedPreferencesImpl$2.run(SharedPreferencesImpl.java:647)
at android.app.SharedPreferencesImpl.enqueueDiskWrite(SharedPreferencesImpl.java:666)
at android.app.SharedPreferencesImpl.access$100(SharedPreferencesImpl.java:55)
at android.app.SharedPreferencesImpl$EditorImpl.commit(SharedPreferencesImpl.java:585)
Related
I am opening and closing activities containing a Unity Player view and eventually after opening and closing multiple times the app will crash with a native error:
/CRASH: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) etc.
When I convert the symbols I get this:
jni::Java_bitter_jnibridge_JNIBridge_00024InterfaceProxy_delete(_JNIEnv*, _jobject*, long long)
That line appears to be in here: https://github.com/bitter/android-jni-bridge/blob/master/Proxy.cpp so it is causing an error when a pointer is being deleted. I assume I haven't unloaded Unity correctly and that's the problem? Any help on how to properly unload Unity?? (I am currently using Application.Unload())
Does anyone know what this means?
p.s (I have a setup using some tutorials e.g https://forum.unity.com/threads/using-unity-android-in-a-sub-view.98315/ and https://medium.com/#davidbeloosesky/embedded-unity-within-android-app-7061f4f473a) so as all my code is too much to post, I'll just say I have an activity which initialises the UnityPlayer and then all of the necessary callbacks copied from UnityPlayerActivity there :))
In my Android app, I am constantly getting the following two errors in my logcat:
06-02 20:33:16.070: E/MoreInfoHPW_ViewGroup(13983): Parent view is not a TextView
06-02 20:33:12.010: E/ViewRootImpl(13983): sendUserActionEvent() mView == null
My app runs completely fine in spite of these two errors, and I've found no definitive answer as to whether or not they are harmful (or even fixable!) errors or if they can be safely ignored. Thus far I've been doing fine just ignoring them, but I wanted this to be asked since I'm sure I am not the only one confused as to what these two errors mean.
For reference, I am getting these errors while running the app via adb on a Samsung Galaxy S5.
EDIT: The Parent view is not a TextView error happens at many times, but notably it happens whenever I press the back button on the action bar and when I start a new activity by pressing a button. I'm using the support library, minSdk=8.
Yes you can ignore, it's a known issue with Samsung models. If it bothers you, maybe you can replace
context.startActivity(....);
with:
startActivity(new Intent(....));
and see if it works for you too, as indicated in this answer:
https://stackoverflow.com/a/24592235/3202370
I hope it helps.
I'm getting a very weird error ever since I have "ported" the spritebatch code from Nokia's site. It runs well as a desktop applcation emulated by POWERVR. But on Android I only get a blank screen (in fact its black.) This happens if I just try to display a image, but it doesn't crash.
Here is where comes the weird part comes in: if i put glGeterror(); in the update function it works fine! (slowly, but displays everything fine) and geterror code returns 0. I have no idea what is going on or how to debug it, as I'm new to OpenGL but everything looks correct in the source. I spitted geterrors all around the code but without any clue. I've attached my project if you want to take a look. You will need Visual Studio + vsandroid to compile.
apparently the problem is not on the sprite batch, but in the java code. I replaced for another one that uses surface view and no longer im getting this esotheric behavior.
In my project I have an error in run time: failed to get tags 4/15,although it works without "ANR" dialog.But some times in project main activity,when it becomes visible,background changes and an icon's background becomes activity's background.I checked my code,every things is in it's place and when I debug project,background name is true,even when it's background is wrong.Really I am not sure that this problem is in about that error,but when I try debugging,only this error is appearing in LogCat.
How I can solve this problem?I use eclipse.
I am getting a NullPointerException at SuggestionSpan. (Stack trace included below). As the stack trace does not include any of my code, I have absolutely no idea where to start debugging.
The error can be reproduced whenever I press space (or select a word) while using an EditText. I tried multiple keyboards including the stock Android one but the same error appears.
FATAL EXCEPTION: main
java.lang.NullPointerException
at android.text.style.SuggestionSpan.<init>(SuggestionSpan.java:128)
at android.text.style.SuggestionSpan.<init>(SuggestionSpan.java:101)
at android.widget.SpellChecker.createMisspelledSuggestionSpan(SpellChecker.java:392)
at android.widget.SpellChecker.onGetSuggestions(SpellChecker.java:300)
at android.view.textservice.SpellCheckerSession.handleOnGetSuggestionsMultiple(SpellCheckerSession.java:198)
at android.view.textservice.SpellCheckerSession.access$000(SpellCheckerSession.java:86)
at android.view.textservice.SpellCheckerSession$1.handleMessage(SpellCheckerSession.java:112)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
EDIT: I can only reproduce the error on my Nexus S with 4.0.3, but not on emulators with other OS versions. Weird.
EDIT 2: Strange thing happened! I just dragged an EditText into another activity and the same thing happens. No code is attached to it nor any XML changes made to it.
After days of investigation, it turns out that getResources().getConfiguration().locale is null. I am not sure if it is a problem specific to some versions of Android / some devices (mine is Nexus S running 4.0.3).
But I worked around this issue by checking in the constructor of the Activity (since the context given to the SuggestionSpan is my Activity) whether the locale is null, and then set it to the default one if it is.
// to prevent a weird bug where locale is null
Configuration config = getResources().getConfiguration();
if (config.locale == null)
config.locale = Locale.getDefault();
That's what I did. I am quite sure it's not the best way though. Anyone have any more ideas?