简体   繁体   中英

Android app occasionally crashing with unhelpful error message

Every so often my Android app crashes on start-up, and gives the following exception:

05-31 01:36:26.989: E/AndroidRuntime(13825): FATAL EXCEPTION: main
05-31 01:36:26.989: E/AndroidRuntime(13825): java.lang.NullPointerException
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.view.ViewGroup.resolveTextAlignment(ViewGroup.java:5318)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.view.View.resolveRtlPropertiesIfNeeded(View.java:11591)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.view.ViewGroup.resolveRtlPropertiesIfNeeded(ViewGroup.java:5262)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.view.ViewGroup.resolveRtlPropertiesIfNeeded(ViewGroup.java:5267)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.view.ViewGroup.resolveRtlPropertiesIfNeeded(ViewGroup.java:5267)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.view.ViewGroup.resolveRtlPropertiesIfNeeded(ViewGroup.java:5267)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.view.View.setLayoutDirection(View.java:5901)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1190)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.view.Choreographer.doCallbacks(Choreographer.java:562)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.view.Choreographer.doFrame(Choreographer.java:532)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.os.Handler.handleCallback(Handler.java:725)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.os.Handler.dispatchMessage(Handler.java:92)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.os.Looper.loop(Looper.java:137)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at android.app.ActivityThread.main(ActivityThread.java:5041)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at java.lang.reflect.Method.invokeNative(Native Method)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at java.lang.reflect.Method.invoke(Method.java:511)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
05-31 01:36:26.989: E/AndroidRuntime(13825):    at dalvik.system.NativeStart.main(Native Method)

It doesn't seem to reference my code in the exception, which makes it quite difficult to debug. I'm new to Android development (but fairly experienced with iOS development). Any ideas what this exception means and how I can fix it? It does only occur sometimes on startup.

Thanks!

powerj1984: D'oh, yeah you're right. On a background thread I was calling a method which updated the UI at the bottom of it (forgot about that). Thanks for your help guys, you rock.

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