16

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?

Peter
  • 10,910
  • 3
  • 35
  • 68

2 Answers2

7

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.

Peter
  • 10,910
  • 3
  • 35
  • 68
  • Yes there was a regression in the new crawler. The bug has been fixed and pushed. If the problem still appears for your app, please let us know. – Saswat Anand Nov 08 '17 at 01:31
  • @SaswatAnand Unfortunately "re-signing" of app with the "new crawler" still doesn't work properly. Today I got the same error caused by duplicated classes, injected by the crawler: "Found duplicated class when checking oat files: 'Ljunit/framework/Assert;' in /data/app/com.google.android.apps.mtaas.crawler-1/base.apk and /data/app/org.andstatus.app-1/base.apk" Report sent. – yvolk Dec 26 '17 at 09:05
  • @yvolk Thanks for reporting. Yes it indeed seems like a bug in the crawler. However, the bug is different from the one that caused the issue originally reported in this post. Will look into it asap. – Saswat Anand Dec 27 '17 at 07:35
  • 1
    @SaswatAnand I'm seeing this issue now with gson: `07-24 12:14:08.434: W/zygote64(8922): Found duplicated class when checking oat files: 'Lcom/google/gson/a;' in /data/app/com.google.android.apps.mtaas.crawler-1A7hyrp7jxNTXABLVGobWw==/base.apk and /data/app/com.nomorobo-Uda3trOXwtXakvbS0uwG2Q==/base.apk` which caused the exception: `java.lang.IllegalAccessError: Illegal class access` But oddly enough this is only happening with the Pixel on Android 8.0. – bladerunner Jul 24 '18 at 20:50
  • 1
    @SaswatAnand I received ClassCastException and NoSuchMethodError in the Gson library when running tests on the Pre-launch crawlers. Works fine on real devices. Crashed on 8/9 virtual devices. – Charlie Jul 26 '18 at 08:28
  • @SaswatAnand I am also getting the error mentioned by Charlie in my recent beta submissions. – venkat Jul 26 '18 at 17:18
  • I'm also getting strange NoSuchMethod errors from gson. Turned out these were false reports in my case. I tested my app on a lot of devices on Firebase TestLab and all of the tests passed, still I got crash reports from those devices. – WPMed Jul 27 '18 at 12:13
0

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.

Saswat Anand
  • 358
  • 2
  • 10