java.lang.RuntimeException only on Nexus 4 smartphone - android

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?

Related

Camera code crashing on L.G G6 in Play store pre launch reports

i have an a simple app that takes a picture for sending it over to a server. The app works fine and all, but for some strange and unknown reasons it always crashes on LG-G6 devices in testing by google.
The pre launch report crash logs always points to following code which is setting FOCUS mode.
I have tried all flash modes yet the app crashes.
if(getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_AUTOFOCUS)) {
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);
camera.setParameters(parameters); //line 328
}
Following is the excerpt from crash log
FATAL EXCEPTION: ControllerMessenger Process:
com.localgsa.HcadPublicA, PID: 11403 java.lang.RuntimeException:
setParameters failed at
android.hardware.Camera.native_setParameters(Native Method) at
android.hardware.Camera.setParameters(Camera.java:2034) at
com.localgsa.hcad.activities.license_capture.LicenseFrontCaptureActivity.surfaceChanged(LicenseFrontCaptureActivity.java:328)
at android.view.SurfaceView.updateWindow(SurfaceView.java:646) at
android.view.SurfaceView$3.onPreDraw(SurfaceView.java:162) at
android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
at
android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2288)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1306) at
android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6579)
at
android.view.Choreographer$CallbackRecord.run(Choreographer.java:871)
at android.view.Choreographer.doCallbacks(Choreographer.java:683) at
android.view.Choreographer.doFrame(Choreographer.java:619) at
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
at android.os.Handler.handleCallback(Handler.java:751) at
android.os.Handler.dispatchMessage(Handler.java:95) at
androidx.test.espresso.base.Interrogator.a(Interrogator.java:19) at
androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:164)
at
androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:156)
at
androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:34)
at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:75)
at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:50)
at androidx.test.espresso.action.Tap.c(Tap.java:9) at
androidx.test.espresso.action.Tap.a(Tap.java:19) at
androidx.test.espresso.action.Tap$1.b(Tap.java:2) at
androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:22)
at
androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:9)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:78)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:94)
at
androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:3)
at java.util.concurrent.FutureTask.run(FutureTask.java:237) at
android.os.Handler.handleCallback(Handler.java:751) at
android.os.Handler.dispatchMessage(Handler.java:95) at
android.os.Looper.loop(Looper.java:154) at
android.app.ActivityThread.main(ActivityThread.java:6316) at
java.lang.reflect.Method.invoke(Native Method) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
Can anyone provide me with some insight? This issue has been pestering me for a while.
P.S i don't have a physical LG G6 device with me. I have tested the app on a slightly older LG device and the app ran fine.

Unity Android 6 Fragment$InstantiationException

recently (past few weeks maybe) most of the android 6 users of my app started to suffer from crashes. UnityPlayerActivity failed to start with exception logged: android.app.Fragment$InstantiationException.
Stack trace:
java.lang.RuntimeException:
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2450)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
android.app.ActivityThread.-wrap11(ActivityThread.java:0)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:148)
android.app.ActivityThread.main(ActivityThread.java:5461)
java.lang.reflect.Method.invoke(Native Method:0)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.app.Fragment$InstantiationException:
android.app.Fragment.instantiate(Fragment.java:628)
android.app.FragmentState.instantiate(Fragment.java:106)
android.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:1858)
android.app.FragmentController.restoreAllState(FragmentController.java:122)
android.app.Activity.onCreate(Activity.java:918)
com.unity3d.player.UnityPlayerActivity.onCreate(Unknown Source:0)
android.app.Activity.performCreate(Activity.java:6251)
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2403)
Initially my first thought was permissions problem but I can't reproduce this error on any of my android 6 devices even if I deny permission (WRITE_EXTERNAL_STORAGE).
Is there is any workaround for this problem(if this problem is a common for Unity on Android 6)?
Thanks in advance!
PS:
Unity version 5.5.0f3,
Android version from crush reports 6.0

Android media recorder crashes on stop

I'm trying to implement camera2api provided by google with this link
https://github.com/googlesamples/android-Camera2Video
Everything works fine but after after stoping the video the app crashes on mediarecorder.stop()
I'm using Xiaomi 4A
Logcat:
4-21 23:37:42.189 20375-20375/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.android.camera2video, PID: 20375
java.lang.RuntimeException: stop failed.
at android.media.MediaRecorder.stop(Native Method)
at com.example.android.camera2video.Camera2VideoFragment.stopRecordingVideo(Camera2VideoFragment.java:687)
at com.example.android.camera2video.Camera2VideoFragment.onClick(Camera2VideoFragment.java:314)
at android.view.View.performClick(View.java:5207)
at android.view.View$PerformClick.run(View.java:21177)
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:5441)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
I was using the same link and it was crashing on mediarecorder.onStop() on my Xiaomi 4A and it was giving IllegalStateException but code was working perfectly fine with other devices.
I solved the issue by simply updating my device using miui updater.

How to fix Developer Console testing failure, without reference to the own code?

The Google Play Developer Console shows me the following Pre-Launch-Report, for the Galaxy S6, after uploading the APK. The other nine devices, which Google uses to test the APK, have no error.
The provided stacktrace shows none of my code lines. How can I figure out, whether this is a real problem, and how can I fix it, if it is not based on my code?
Developer Console output:
Problem: java.lang.NullPointerException: Attempt to read from field 'java.lang.String android.accounts.Account.type' on a null object reference
FATAL EXCEPTION: main
Process: com.google.android.videos, PID: 28537
java.lang.NullPointerException: Attempt to read from field 'java.lang.String android.accounts.Account.type' on a null object reference
at android.os.Parcel.readException(Parcel.java:1552)
at android.os.Parcel.readException(Parcel.java:1499)
at com.android.vending.contentfilters.IContentFiltersService$Stub$Proxy.getContentFiltersAndIntent(SourceFile:139)
at com.google.android.videos.contentfiltering.ContentFiltersManager.saveContentFiltersToPreference(SourceFile:438)
at com.google.android.videos.contentfiltering.ContentFiltersManager.access$100(SourceFile:81)
at com.google.android.videos.contentfiltering.ContentFiltersManager$1.onServiceConnected(SourceFile:423)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1314)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1331)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6837)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Is this normal? Why do I get this error only for the Galaxy S6?

Android: null pointer exception inside in SmsManager sendTextMessage

Got crash from user's device (could not reproduce by myself) during sending SMS via smsManager.sendTextMessage
User's device is Sony Xperia Z2, Android 5.1.1
Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'java.lang.String android.content.pm.PackageInfo.packageName' on a null object reference
at android.os.Parcel.readException(Parcel.java:1562)
at android.os.Parcel.readException(Parcel.java:1505)
at com.android.internal.telephony.ISms$Stub$Proxy.sendTextForSubscriber(ISms.java:1306)
at android.telephony.SmsManager.sendTextMessage(SmsManager.java:270)
at com.xabber.android.ui.sms.SmsVerificationManager.requestPhoneNumberVerification(SmsVerificationManager.java:80)
at com.xabber.android.ui.RegistrationFragment1PhoneAndName.onNextPressed(RegistrationFragment1PhoneAndName.java:193)
at com.xabber.android.ui.RegistrationActivity.onClick(RegistrationActivity.java:122)
at android.view.View.performClick(View.java:4856)
at android.view.View$PerformClick.run(View.java:19956)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:5373)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
SMS sending works excellent on my device and several others. Seems, that it is Android bug.
I could not find anything similar except for https://groups.google.com/forum/#!topic/automate-user/8gyfmMvPYDY
but they didn't solve it.

Categories

Resources