qq1175387339
qq1175387339
采纳率0%
2017-06-05 04:46 阅读 2.5k

android app 安装在荣耀6x出现闪退,抓捕的错误如下

debug运行后,在初始化的setContentView(R.layout.activity_mlogin);方法出现如下错误:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.medex.Activity.release/com.medex.Activity.miha.MLoginActivity}: java.lang.NullPointerException: Attempt to read from field 'android.os.MessageQueue android.os.Looper.mQueue' on a null object reference

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2793)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)

Caused by: java.lang.NullPointerException: Attempt to read from field 'android.os.MessageQueue android.os.Looper.mQueue' on a null object reference

at android.os.Handler.<init>(Handler.java:236)
at android.view.accessibility.AccessibilityManager$MyHandler.<init>(AccessibilityManager.java:686)
at android.view.accessibility.AccessibilityManager.<init>(AccessibilityManager.java:221)
at android.view.accessibility.AccessibilityManager.getInstance(AccessibilityManager.java:205)
at android.view.View.setFlags(View.java:11440)
at android.view.ViewGroup.initViewGroup(ViewGroup.java:590)
at android.view.ViewGroup.<init>(ViewGroup.java:579)
at android.view.ViewGroup.<init>(ViewGroup.java:574)
at android.view.ViewGroup.<init>(ViewGroup.java:570)
at android.view.ViewGroup.<init>(ViewGroup.java:566)
at android.widget.FrameLayout.<init>(FrameLayout.java:78)
at com.android.internal.policy.DecorView.<init>(DecorView.java:247)
at com.android.internal.policy.PhoneWindow.generateDecor(PhoneWindow.java:2401)
at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2804)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:443)
at com.android.internal.policy.HwPhoneWindow.setContentView(HwPhoneWindow.java:280)
at android.app.Activity.setContentView(Activity.java:2515)
at com.medex.Activity.Base.a.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:6910)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2746)
... 9 more
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

3条回答 默认 最新

  • chenbaige legendCoder 2017-06-05 06:26

    是不是用到了对线程,而在子线程中Looper对象还没有创建成功。这样会导致Looper.mQueue的空指针。

    点赞 评论 复制链接分享
  • qq1175387339 qq1175387339 2017-06-05 09:29

    没有,就是初始化啊,项目在别的手机可以,就是在荣耀6x上不行,点击就会出现闪退

    点赞 评论 复制链接分享
  • chenxu2614 Tauren2614 2017-06-06 01:46

    首先创建Application都没问题,怎么会在Activity创建阶段Main线程的mQueue为空,这不科学
    是不是其它地方引起的应用崩溃,导致这里的mQueue为空

    点赞 评论 复制链接分享

相关推荐