Since recently my app started to contain strange error messages in the pre-launch reports (automatically generated after upload to the Play store).
These reports contain exceptions such as the following:
Exception java.lang.NoSuchMethodError: No interface method a(Landroid/arch/lifecycle/e;Landroid/arch/lifecycle/b$a;)V in class Landroid/arch/lifecycle/GenericLifecycleObserver; or its super classes (declaration of 'android.arch.lifecycle.GenericLifecycleObserver' appears in /data/app/com.google.android.apps.mtaas.crawler-1/base.apk)
android.arch.lifecycle.f$a.a (f.java:326)
android.arch.lifecycle.f.a (f.java:159)
com.firebase.ui.database.FirebaseRecyclerAdapter.<init> (FirebaseRecyclerAdapter.java:40)
And:
Exception java.lang.NoSuchMethodError: No static method a(Landroid/app/Activity;)V in class Landroid/arch/lifecycle/ReportFragment; or its super classes (declaration of 'android.arch.lifecycle.ReportFragment' appears in /data/app/com.google.android.apps.mtaas.crawler-1/base.apk)
android.arch.lifecycle.LifecycleDispatcher$DispatcherActivityCallback.onActivityCreated (LifecycleDispatcher.java:77)
android.app.Application.dispatchActivityCreated (Application.java:219)
android.app.Activity.onCreate (Activity.java:1040)
android.support.v4.app.SupportActivity.onCreate (SupportActivity.java:66)
android.support.v4.app.FragmentActivity.onCreate (FragmentActivity.java:285)
android.support.v7.app.AppCompatActivity.onCreate (AppCompatActivity.java:84)
And:
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.arch.core.internal.SafeIterableMap.size()' on a null object reference
at android.arch.lifecycle.LifecycleRegistry.getObserverCount(LifecycleRegistry.java:204)
at android.arch.lifecycle.ProcessLifecycleOwner.b(ProcessLifecycleOwner.java:154)
at android.arch.lifecycle.ProcessLifecycleOwner.a(ProcessLifecycleOwner.java:100)
at android.arch.lifecycle.LifecycleRuntimeTrojanProvider.onCreate(LifecycleRuntimeTrojanProvider.java:36)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1751)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1726)
at android.app.ActivityThread.installProvider(ActivityThread.java:6031)
... 10 more
The strange thing is that my released app seems to be running fine on real devices (the exceptions appear only during the pre-launch tests).
I tried to revert all (major) changes performed since the last build in which I had no pre-launch problem: from API 26 back to API 27, older version of the support libs, no D8 etc., but no success so far: of the 9 tests being performed only 1 or 2 succeed, the rest fails with this type of errors.
What can I do to solve this?
Just got an answer from Google Play developer support. They are looking into the problem.
As a workaround you can go back to the previous version of the crawler by opting out of the newly released one.
Here's how to opt-out:
- Sign in to your Play Console.
- Select an app.
- Select Release management > Pre-launch report > Settings. In the “Pre-launch report version” section, move the Opt-out switch to the right until it turns blue.
After this, the launch reports appear correctly again.
PS - This will disable the default tests done by the Google Play and you might miss any other errors from other cause. Hence, be sure to implement your own tests before releasing into production.
The Gson error was caused by a regression. The issue has been fixed. It should work as expected after the fix is released in a day or two.
来源:https://stackoverflow.com/questions/47099757/pre-launch-report-failures-due-to-missing-methods-in-com-google-android-apps-mt