U
U
UserTwo2020-11-14 12:10:35
Android
UserTwo, 2020-11-14 12:10:35

How to detect an error if the application does not crash?

Help identify the error, the application does not crash during the test, but there are enough error messages in the google console

java.lang.RuntimeException: 
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2969)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3047)
  at android.app.ActivityThread.-wrap11 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1777)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:166)
  at android.app.ActivityThread.main (ActivityThread.java:6861)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:450)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:936)
Caused by: androidx.fragment.app.Fragment$InstantiationException: 
  at androidx.fragment.app.Fragment.instantiate (Fragment.java:612)
  at androidx.fragment.app.FragmentContainer.instantiate (FragmentContainer.java:57)
  at androidx.fragment.app.FragmentManager$3.instantiate (FragmentManager.java:483)
  at androidx.fragment.app.FragmentStateManager.<init> (FragmentStateManager.java:88)
  at androidx.fragment.app.FragmentManager.restoreSaveState (FragmentManager.java:2711)
  at androidx.fragment.app.FragmentController.restoreSaveState (FragmentController.java:198)
  at androidx.fragment.app.FragmentActivity$2.onContextAvailable (FragmentActivity.java:149)
  at androidx.activity.contextaware.ContextAwareHelper.dispatchOnContextAvailable (ContextAwareHelper.java:99)
  at androidx.activity.ComponentActivity.onCreate (ComponentActivity.java:296)
  at androidx.fragment.app.FragmentActivity.onCreate (FragmentActivity.java:269)
  at com.vadimfedchuk1994gmail.radio.MainActivity.onCreate (MainActivity.java:33)
  at android.app.Activity.performCreate (Activity.java:7110)
  at android.app.Activity.performCreate (Activity.java:7101)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1214)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2922)
Caused by: java.lang.NoSuchMethodException: 
  at java.lang.Class.getConstructor0 (Class.java:2320)
  at java.lang.Class.getConstructor (Class.java:1725)
  at androidx.fragment.app.Fragment.instantiate (Fragment.java:597)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2020-11-14
@UserTwo

It seems that you have a fragment that does not have a constructor without parameters. This happens when restoring the state of the application, when all fragments must be created anew, the fragment manager does this through reflection and cannot find this constructor.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question