仅在Nexus 4智能手机上为java.lang.RuntimeException

时间:2018-11-15 11:45:04

标签: android nullpointerexception admob chromium nexus-4

我已将我的应用发布到Google Play,实际上我每天有700位活跃用户,我正在尝试修复出现的崩溃,但有一个非常奇怪的崩溃

 Fatal Exception: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.hardware.usb.action.USB_DEVICE_DETACHED flg=0x10 pkg=com.tomatedigital.instagramgiveawaywinner } in org.chromium.media.AudioManagerAndroid$5@a283c54
           at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:891)
           at android.os.Handler.handleCallback(Handler.java:739)
           at android.os.Handler.dispatchMessage(Handler.java:95)
           at android.os.Looper.loop(Looper.java:148)
           at android.app.ActivityThread.main(ActivityThread.java:5420)
           at java.lang.reflect.Method.invoke(Method.java)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

    Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'int android.hardware.usb.UsbDevice.getInterfaceCount()' on a null object reference
           at org.chromium.media.AudioManagerAndroid.hasUsbAudioCommInterface(AudioManagerAndroid.java:1224)
           at org.chromium.media.AudioManagerAndroid.access$1200(AudioManagerAndroid.java:43)
           at org.chromium.media.AudioManagerAndroid$5.onReceive(AudioManagerAndroid.java:1254)
           at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:881)
           at android.os.Handler.handleCallback(Handler.java:739)
           at android.os.Handler.dispatchMessage(Handler.java:95)
           at android.os.Looper.loop(Looper.java:148)
           at android.app.ActivityThread.main(ActivityThread.java:5420)
           at java.lang.reflect.Method.invoke(Method.java)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

此错误似乎仅在以下一种特定硬件上发生:

    Device
    Brand: LGE
    Model: Nexus 4
    Orientation: Portrait
    RAM free: 1.12 GB
    Disk free: 690.85 MB
    Operating System
    Version: 6.0.1
    Orientation: Portrait
    Rooted: No

因此,每天有700多个用户,每周有2000个以上的用户,但只有这种特定的硬件会产生此错误

我的应用没有直接使用铬或任何媒体材料,因此我认为在admob的广告视频中会发生此错误

有人可以帮助我修复它,或者至少捕获异常并向用户显示友好消息吗?

0 个答案:

没有答案