Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google reporting app crashes on some phones #376

Open
jonathanbataire opened this issue Oct 1, 2024 · 6 comments · May be fixed by #377
Open

Google reporting app crashes on some phones #376

jonathanbataire opened this issue Oct 1, 2024 · 6 comments · May be fixed by #377
Assignees
Labels
Type: Bug Fix something that isn't working as intended

Comments

@jonathanbataire
Copy link
Contributor

jonathanbataire commented Oct 1, 2024

Describe the bug
Google play is reporting app crashes on TECNO TECNO-KF6j (TECNO SPARK 7) & TECNO TECNO-KG5j (TECNO SPARK 8C)

Exception java.lang.RuntimeException:
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3628)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3873)
  at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:85)
  at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2197)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:268)
  at android.app.ActivityThread.main (ActivityThread.java:8016)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:627)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:997)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setOnTouchListener(android.view.View$OnTouchListener)' on a null object reference
  at L.H.onCreate (SourceFile:17)
  at android.app.Fragment.performCreate (Fragment.java:2486)
  at android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1261)
  at android.app.FragmentManagerImpl.moveFragmentToExpectedState (FragmentManager.java:1581)
  at android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1642)
  at android.app.FragmentManagerImpl.dispatchMoveToState (FragmentManager.java:3052)
  at android.app.FragmentManagerImpl.dispatchCreate (FragmentManager.java:2999)
  at android.app.FragmentController.dispatchCreate (FragmentController.java:173)
  at android.app.Activity.onCreate (Activity.java:1601)
  at org.medicmobile.webapp.mobile.EmbeddedBrowserActivity.onCreate (SourceFile:1)
  at android.app.Activity.performCreate (Activity.java:8077)
  at android.app.Activity.performCreate (Activity.java:8061)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1315)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3601)

CHT Android version: 1.4

Phone specifications

RAM: 2.9 – 3.0 GB
Android version: Android 11 (SDK 30)
System on Chip: Mediatek MT6762d
CPU: Unknown
GPU: Unknown
ABI: arm64-v8a, armeabi-v7a,armeabi

@jonathanbataire jonathanbataire added the Type: Bug Fix something that isn't working as intended label Oct 1, 2024
@binokaryg
Copy link
Member

binokaryg commented Oct 1, 2024

This error is showing up on other phones with Android versions 8.1 - 14:

  • OnePlus OP5DA6L1
  • Samsung m32
  • Realme RMX3231
  • Samsung a04
  • others

For PRTP Gandaki, the user-perceived crash rate is 11.49% which is very high according to Google. The threshold is 1.09%.

Here are the Crash details for PRTP Gandaki.

@binokaryg
Copy link
Member

The same error was reported by Google when doing pre-launch testing. Here are the details:

Device specifications:

Model name Small Desktop (x86) (virtual)
Manufacturer Generic
Android version Android 12L (SDK 32)
Locale en_US
Screen size 1366 x 768
Screen density (DPI) 160
RAM (total memory) -
OpenGL ES version -
ABI x86_64
CPU -
Stacktrace
Exception java.lang.RuntimeException: Unable to start activity ComponentInfo{org.medicmobile.webapp.mobile.gandaki_ne/org.medicmobile.webapp.mobile.EmbeddedBrowserActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setOnTouchListener(android.view.View$OnTouchListener)' on a null object reference
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3707)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3864)
  at android.app.ActivityThread.handleRelaunchActivityInner (ActivityThread.java:5811)
  at android.app.ActivityThread.handleRelaunchActivity (ActivityThread.java:5703)
  at android.app.servertransaction.ActivityRelaunchItem.execute (ActivityRelaunchItem.java:71)
  at android.app.servertransaction.ActivityTransactionItem.execute (ActivityTransactionItem.java:45)
  at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2253)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:201)
  at android.os.Looper.loop (Looper.java:288)
  at android.app.ActivityThread.main (ActivityThread.java:7870)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1003)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setOnTouchListener(android.view.View$OnTouchListener)' on a null object reference
  at org.medicmobile.webapp.mobile.OpenSettingsDialogFragment.onCreate (OpenSettingsDialogFragment.java:17)
  at android.app.Fragment.performCreate (Fragment.java:2486)
  at android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1261)
  at android.app.FragmentManagerImpl.moveFragmentToExpectedState (FragmentManager.java:1581)
  at android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1642)
  at android.app.FragmentManagerImpl.dispatchMoveToState (FragmentManager.java:3052)
  at android.app.FragmentManagerImpl.dispatchCreate (FragmentManager.java:2999)
  at android.app.FragmentController.dispatchCreate (FragmentController.java:174)
  at android.app.Activity.onCreate (Activity.java:1634)
  at org.medicmobile.webapp.mobile.EmbeddedBrowserActivity.onCreate (EmbeddedBrowserActivity.java:1)
  at android.app.Activity.performCreate (Activity.java:8074)
  at android.app.Activity.performCreate (Activity.java:8054)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1341)
  at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate (MonitoringInstrumentation.java:2)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3688)
video.mp4

It's not clear from the screen recording at what point exactly it crashed, probably at the end after initial sync is complete.

Full logcat: logcat.txt

@binokaryg
Copy link
Member

Of the three Nepal apps, only those two on 1.4.0 have this error: PRTP Gandaki, CHIS Nepal.
mHealth Lumbini is on v1.3.0-alpha-2.lumbini-ne, and this error is not seen.

@sugat009
Copy link
Member

sugat009 commented Oct 1, 2024

I've looked into this and I think I've figured out the cause of the error. I couldn't recreate this but judging by the stack trace and the previous error which was fixed #338, I have the following findings.

Here, in the EmbeddedBrowserActivity (the main class/activity for the app) calls the Fragment OpenSettingsDialogFragment class, which will work as expected in a normal case. However, in some cases such as hibernation or pause or something that needs the app to be paused and resumed the Fragment class OpenSettingsDialogFragment fails to obtain the activity from which it is being called. Ref. Hence, the view variable here is set to null as per the exception stack trace and cannot call setOnTouchListener method.

I haven't implemented and tested this all out but the solution seems to be to implement androidx.fragment.app.Fragment and not android.app.Fragment. androidx.fragment.app.Fragment seems to have more flexibility and functionalities to deal with the required functionality.

@sugat009 sugat009 self-assigned this Oct 2, 2024
sugat009 added a commit that referenced this issue Oct 2, 2024
@binokaryg
Copy link
Member

Using Android emulator with version 12L on small desktop x86 virtual device, the error was reproduced. It occurred when using the "Split" action in the overview to start split-screen mode with a tap.

20241002-1348-25.9588927.mp4

I was also able to reproduce the error on my phone when switching to a split screen view where one of the open apps was CHT.

@derickl
Copy link
Member

derickl commented Oct 13, 2024

I see this in Kenya as well

org.medicmobile.webapp.mobile.OpenSettingsDialogFragment.onCreate
java.lang.NullPointerException

There are 62,196 crashes in the last 28 days. Devices running android 13 are affected the most.
Image

Exception java.lang.RuntimeException: Unable to start activity ComponentInfo{org.medicmobile.webapp.mobile.moh_kenya_echis/org.medicmobile.webapp.mobile.EmbeddedBrowserActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setOnTouchListener(android.view.View$OnTouchListener)' on a null object reference
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3704)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3861)
  at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:105)
  at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:136)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:96)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2273)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:201)
  at android.os.Looper.loop (Looper.java:288)
  at android.app.ActivityThread.main (ActivityThread.java:7976)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:553)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1003)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setOnTouchListener(android.view.View$OnTouchListener)' on a null object reference
  at org.medicmobile.webapp.mobile.OpenSettingsDialogFragment.onCreate (OpenSettingsDialogFragment.java:17)
  at android.app.Fragment.performCreate (Fragment.java:2486)
  at android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1261)
  at android.app.FragmentManagerImpl.moveFragmentToExpectedState (FragmentManager.java:1581)
  at android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1642)
  at android.app.FragmentManagerImpl.dispatchMoveToState (FragmentManager.java:3072)
  at android.app.FragmentManagerImpl.dispatchCreate (FragmentManager.java:3019)
  at android.app.FragmentController.dispatchCreate (FragmentController.java:174)
  at android.app.Activity.onCreate (Activity.java:1612)
  at org.medicmobile.webapp.mobile.EmbeddedBrowserActivity.onCreate (EmbeddedBrowserActivity.java:1)
  at android.app.Activity.performCreate (Activity.java:8094)
  at android.app.Activity.performCreate (Activity.java:8074)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1329)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3674)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Fix something that isn't working as intended
Projects
Status: This Week's commitments
Development

Successfully merging a pull request may close this issue.

4 participants