微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

java – Android应用没有崩溃,但没有响应未捕获的异常

我最近注意到,当一个未捕获的异常发生时,我的应用程序不会崩溃,但它没有响应.我使用Google Analytics(分析)来了解崩溃的情况,我怀疑这可能是问题的原因.

当我在onCreate()(在super.onCreate()之后)抛出一个NullPointerException时,应用程序会显示一个白色的屏幕,但不会崩溃.

Logcat说:

06-30 14:00:59.386  26259-26259/? I/GAv4﹕ Google Analytics 7.5.71 is starting up. To enable debug logging on a device run:
    adb shell setprop log.tag.GAv4 DEBUG
    adb logcat -s GAv4
06-30 14:00:59.398  26259-26259/? W/GAv4﹕ AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See http://goo.gl/8Rd3yj for instructions.
06-30 14:00:59.409  26259-26259/? W/GAv4﹕ CampaignTrackingReceiver is not registered,not exported or is disabled. Installation campaign tracking is not possible. See http://goo.gl/8Rd3yj for instructions.
06-30 14:00:59.414  26259-26295/? W/GAv4﹕ AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See http://goo.gl/8Rd3yj for instructions.
06-30 14:00:59.467  26259-26259/? D/AndroidRuntime﹕ Shutting down VM

我想看到未知的例外,因为如果我没有看到堆栈跟踪和问题的原因,那么很难解决它们.

我可以做些什么来恢复以前的行为?

编辑:删除分析错误报告(不调用tracker.enableExceptionReporting(true);)后,我再次收到崩溃.我使用Google Analytics(分析)从Play Services 7.5.0.

解决方法

Google Analytics(分析)是罪魁祸首.尝试在您使用发行键签署应用程序时开发并启用它时禁用它(或禁用自动报告未捕获的异常).

原文地址:https://www.jb51.cc/android/124702.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐