简体   繁体   中英

Android app on the market received java.lang.IllegalStateException

How can I try to locate the source of this error?

I have received a crash log/stack trace from Flurry but it doesn't provide me with any indication of where in my app the crash originated. (ie Activity or line number)

I haven't experienced any exception with any devices that I have locally tested with so am at a bit of a loss on where to start.

The users haven't reported the crash through Google Play so I don't have a Google Stack trace. The report came from A SONY XPERIA Z1 and two separate SONY C6903 XPERIA LTE.

The app has around 4000 users so it is only something unusual these users are doing or only occurring on these two devices I guess.

What type of error/bug would cause this type of error?

java.lang.IllegalStateException
android.view.View$1.onClick(View.java:3954)
android.view.View.performClick(View.java:4569)
android.view.View$PerformClick.run(View.java:18553)
android.os.Handler.handleCallback(Handler.java:733)
android.os.Handler.dispatchMessage(Handler.java:95)
android.os.Looper.loop(Looper.java:212)
android.app.ActivityThread.main(ActivityThread.java:5151)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:515)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:515)
android.view.View$1.onClick(View.java:3949)
android.view.View.performClick(View.java:4569)
android.view.View$PerformClick.run(View.java:18553)
android.os.Handler.handleCallback(Handler.java:733)
android.os.Handler.dispatchMessage(Handler.java:95)
android.os.Looper.loop(Looper.java:212)
android.app.ActivityThread.main(ActivityThread.java:5151)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:515)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
dalvik.system.NativeStart.main(Native Method)

Edit: All android:onClick events in the app have a corresponding method in the Activity Class in the following format:

public void methodName(View view) {
}

Are any of your views changed outside of your UI thread? Perhaps the view that manages the .onClick or a method triggered from the onClick() itself is accessing a view that has changed, but the UI thread has no knowledge of

I think this occurs when you have a android:onClick attribute in yout layout which references an Activity method that does not exist. The system has to use reflection to look for the method, which can be dangerous. I suggest that you never use this attribute in your views and always set a View.OnClickListener to you clickable views by code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM