很多时候我在Google Play开发者控制台看到的异常都缺少一些重要信息。
例如,我在Google Play上最后一次遇到的崩溃是:
例如,我在Google Play上最后一次遇到的崩溃是:
java.lang.RuntimeException:
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2984)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3045)
at android.app.ActivityThread.-wrap14 (ActivityThread.java)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1642)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:154)
at android.app.ActivityThread.main (ActivityThread.java:6776)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1518)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1408)
Caused by: android.support.v4.app.Fragment$InstantiationException:
at android.support.v4.app.Fragment.instantiate (Fragment.java:431)
at android.support.v4.app.FragmentState.instantiate (Fragment.java:102)
at android.support.v4.app.FragmentManagerImpl.restoreAllState (FragmentManager.java:1952)
at android.support.v4.app.FragmentController.restoreAllState (FragmentController.java:144)
at android.support.v4.app.FragmentActivity.onCreate (FragmentActivity.java:307)
at android.support.v7.app.AppCompatActivity.onCreate (AppCompatActivity.java:58)
at be.gps.android73.activities.LanguageActivity.onCreate (LanguageActivity.java:23)
at be.gps.android73.activities.main.MainActivity.onCreate (MainActivity.java:117)
at android.app.Activity.performCreate (Activity.java:6956)
at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1126)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2927)
现在我能在开发环境中复现这个崩溃。在这种情况下,你会得到相同的堆栈跟踪,但是还有一些关键的额外信息,如下所示。
....
Caused by: android.support.v4.app.Fragment$InstantiationException:
Unable to instantiate fragment be.abc.cba.Abc
make sure class name exists, is public, and has an empty constructor that is public
....
当出现此问题时,可能是由于无法实例化片段 be.abc.cba.Abc,需确保类名存在、为公共类,并且具有公共的空构造函数。
我曾多次看到在Google Play中缺少某些信息。这正常吗?是否有一种方法可以让Google Play提供此信息?