1

I released my app to google play and i'm actually with 700 daily active users, i'm trying to fix the crashes that appear but there is one very weird crash

 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)

This error appears to happen only on one specific hardware what is:

    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

So over 700 daily users and over 2k weekly users but only this specific hardware is generating this error

My app doesn't have any straight usage of chromium or any media stuff, so i believe this error is happening during an ad video from admob

can someone help me to fix it, or at least catch the exception and show a friendly message to the user?

Rafael Lima
  • 3,079
  • 3
  • 41
  • 105
  • Other than a try-catch around that specific code, could it be worth trying to find a nearby device lab so you can debug against that specific bit of hardware? – Michael Dodd Nov 15 '18 at 12:15
  • what specific code? none of these code is mine they are either from android sdk or admob library... as i said in the description i "guess" is from video reward but i dont know where is the call since the code is out of my control – Rafael Lima Nov 15 '18 at 12:37
  • Apologies, my head isn't screwed on properly today. `USB_DEVICE_DETACHED` seems like a very unusual broadcast to be receiving though, my guess would be via USB headphones or connected to a PC via MTP. Again, finding a local device lab or getting your hands on a N4 would be best, I don't think there's enough information in the question to definitively answer it here. – Michael Dodd Nov 15 '18 at 12:42
  • Hey Rafael,did you find any solution for this because i'm getting same error on same device and i'm not able to solve.. i just also saw your question on another site - https://en.programqa.com/question/53318769/. Please help me as fast as you can – Vivek Thummar Mar 09 '20 at 07:35

0 Answers0