I have the following Android exception. It is reported by Bugsense and I cannot find out where it comes from as there is no reference to any class of my app.
java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
at java.util.ArrayList.get(ArrayList.java:304)
at android.widget.HeaderViewListAdapter.isEnabled(HeaderViewListAdapter.java:164)
at android.widget.AbsListView$ListItemAccessibilityDelegate.onInitializeAccessibilityNodeInfo(AbsListView.java:2512)
at android.view.View.onInitializeAccessibilityNodeInfo(View.java:4849)
at android.widget.LinearLayout.onInitializeAccessibilityNodeInfo(LinearLayout.java:1768)
at android.view.View.createAccessibilityNodeInfo(View.java:4812)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:825)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:848)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:848)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:848)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:848)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos(AccessibilityInteractionController.java:734)
at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:205)
at android.view.AccessibilityInteractionController.access$400(AccessibilityInteractionController.java:49)
at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:985)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4867)
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:1007)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
at dalvik.system.NativeStart.main(Native Method)
I do suspect it has something to do with updating a widget. Any ideas on how to trace?
Got similar Nullpointer with a Google map view.
try and turn off any accessibility options enabled on your phone?
And there is a another accessibility bug reported on the Android Issues tracker here
It looks like there is no easy way to turn of accessibility from code, except for overriding the addChildrenForAccessibility method in a custom view. (see above link)
Related
I just finished integrating Firebase real time data base and Authentication into my Android Studio application. It ran successfully two or three times on my Google Nexus 7 genymotion emulator that has google play services on it. Then I tried launching it again and I started getting the below error:
06-25 16:50:46.994 7699-7699/
com.careersvirtualsolutions.uprate E/AndroidRuntime:
FATAL EXCEPTION: main
java.lang.NullPointerException
at com.google.firebase.auth.FirebaseAuth$1.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
I think this has something to do with the Firebase Authentication SDK but I am not sure.
Do you know what this is caused by? How can I solve it?
I actually figured it out, the problem was with the AuthStateListener.
So if you're having a similar issue, try testing your project with the AuthStateListener commented out and see if it launches without crashing. If it does you can then figure out how to replace the existing listener.
Hope this helps in some way!
I'm getting daily crash reports from Google Play. I'm running out of ideas and wondering if there is any tutorials or something on how to find and fix bugs from google plays stack report.
I have done the following
Bought one of the devices it is crashing on, Galaxy tab. Tried to crash it, could not get it to crash. Tied to have a lot of apps running in background still did not crash.
put try catch around all my code where the catch would bring up a generic memory low warning message (ie this really slowed down the app).
Checked all my return values.
From the stack report, I'm assuming it is crashing somewhere in onTouchEvent methed in my cPuzzleView class.
Any help would be GREAT
stack
java.lang.NullPointerException
at com.fairhvaenapps.toddpuzzlefree.cPuzzleView.onTouchEvent(cPuzzleView.java:653)
at android.view.View.dispatchTouchEvent(View.java:7380)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2210)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1953)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2210)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1953)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2210)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1953)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2111)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1559)
at android.app.Activity.dispatchTouchEvent(Activity.java:2478)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2059)
at android.view.View.dispatchPointerEvent(View.java:7560)
at android.view.ViewRootImpl$1.doDispatch(ViewRootImpl.java:338)
at com.lge.view.TouchEventFilter.dispatchFilteredTouchEvent(TouchEventFilter.java:131)
at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3333)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3255)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4418)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4397)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4506)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:179)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:171)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4468)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4525)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
at android.view.Choreographer.doCallbacks(Choreographer.java:562)
at android.view.Choreographer.doFrame(Choreographer.java:530)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5223)
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:797)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:564)
at dalvik.system.NativeStart.main(Native Method)
I have a very strange crash in application.
Stacktrace:
java.lang.IndexOutOfBoundsException: charAt: -1 < 0
at android.text.SpannableStringBuilder.charAt(SpannableStringBuilder.java:112)
at android.text.Selection.setSelection(Selection.java:84)
at android.text.Selection.setSelection(Selection.java:127)
at android.widget.Editor$InsertionHandleView.updateSelection(Editor.java:4971)
at android.widget.Editor$HandleView.positionAtCursorOffset(Editor.java:4647)
at android.widget.Editor$HandleView.updatePosition(Editor.java:4675)
at android.widget.Editor$PositionListener.onPreDraw(Editor.java:2714)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:711)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2097)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1179)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4859)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
at android.view.Choreographer.doCallbacks(Choreographer.java:562)
at android.view.Choreographer.doFrame(Choreographer.java:532)
at android.view.Choreographer$FrameHandler.handleMessage(Choreographer.java:664)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5328)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
I got the stack trace without any links on my application's packages (classes/methods).
Has anyone encountered this problem? Thx.
EDIT
Can you see, the stack trace has not any links on my application's packages/classes, but app anyway crashed.
UPD
I use Selection.setSelection. I don't use SpannableStringBuilder.
#Override
public void afterTextChanged(Editable s) {
if (!s.toString().isEmpty()) {
Selection.setSelection(s, s.length());
}
}
This seems to be an OS bug which require a combination of a certain OS version(e.g. 4.1.2) and a certain device(e.g. Galaxy S3 I9300). This is not your problem. Unfortunately I don't know how to get around this either.
I'm curious how you ran into this issue. Based on the callstack, my guess is you tap on a textview and tried to paste text from clipboard.
Read the first line... it says java.lang.IndexOutOfBoundsException: charAt: -1 < 0. The problem is your string does not have the character you are searching for. Post the code. Then we will see what's wrong...
On Google Play developer console I sometimes get crash reports that I don't understand at all. There is noting from my app code in the stack trace reported. Could anyone shed some light e.g. on this one?
java.lang.NullPointerException
at android.os.Parcel.readException(Parcel.java:1338)
at android.os.Parcel.readException(Parcel.java:1286)
at android.speech.tts.ITextToSpeechService$Stub$Proxy.setCallback(ITextToSpeechService.java:573)
at android.speech.tts.TextToSpeech$Connection.onServiceConnected(TextToSpeech.java:1278)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1125)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1142)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4945)
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)
It's clearly in some Text to Speech package, but how am I, the app author, resposible for this one? I do initialize TTS and my app is reading text aloud, but how can I fix such error?
Greg
here is your errors
ITextToSpeechService$Stub$Proxy.setCallback(ITextToSpeechService.java:573)
it's clearly !
I uploaded an Android Application to the market, and, for some reason a user is getting this error.
java.lang.IllegalArgumentException: Window type can not be changed after the window is added.
at android.os.Parcel.readException(Parcel.java:1331)
at android.os.Parcel.readException(Parcel.java:1281)
at android.view.IWindowSession$Stub$Proxy.relayout(IWindowSession.java:664)
at android.view.ViewRootImpl.relayoutWindow(ViewRootImpl.java:3594)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1193)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2450)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4444)
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:787)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
at dalvik.system.NativeStart.main(Native Method)
I am pretty sure I never use WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG as referenced in other postings. I do however, have a window that switches between WindowManager.LayoutParams.TYPE_PHONE and WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY. Which seems like it could be the error. I would prefer not changing this as it would require me to have two windows instead of just one. Thanks in advance!
check AndroidManifest.xml
<uses-sdk //************
android:targetSdkVersion="X"/>
X must be less than 14 Or remove this attribute.
good luck guy.