gradle-play-publisher: publishApk task fails with NoSuchMethodError: AbstractGoogleJsonClient$Builder.setBatchPath after updating to 1.2.2

publishApkBrandStoreRelease task fails with

java.lang.NoSuchMethodError: com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient$Builder
.setBatchPath(Ljava/lang/String;)Lcom/google/api/client/googleapis/services/AbstractGoogleClient$Builder;

After we updated the plugin to 1.2.2 from 1.2.0. We reverted back to 1.2.0 for now.

Our project has multiple dimensions in the following order: brand, store, buildType. Example variant: FooPlaystoreRelease.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 29 (5 by maintainers)

Most upvoted comments

BTW, if you do want to keep the firebase perf plugin, include it exclusively:

classpath("com.google.firebase:perf-plugin:1.1.5")

The issue is with the firebase-crash plugin that’s included when you use the generic firebase-plugins artifact.

I can confirm, replacing firebase-plugins with perf-plugin fixes the issue. That’s a tricky bug 😲

I don’t get why gradle uses the lower 1.22 version even when gradle-play-publisher declares the 1.23. But since we don’t use the crash plugin, the workaround is good enough.

Thanks! We had a couple of projects affected by this issue.

Also confirming that the problem was caused by the com.google.firebase:firebase-plugins:1.15 Fixed it this way:

buildscript {

    repositories {
        google()
        jcenter()
        // ...
    }

    dependencies {
        // ...
        classpath 'com.google.api-client:google-api-client:1.25.0'
        classpath('com.google.firebase:firebase-plugins:1.1.5') {
            exclude group: 'com.google.api-client', module: 'google-api-client'
        }
        // ...
    }
}

Ok, so it was firebase-perf causing this cryptic issue. I ended up removing it since it’s causing way more problem than being helpful. Thanks.

Make sure your buildscript contains the following - that’s how we resolved issues with running 2.1.0

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'com.google.firebase:firebase-plugins:1.1.5'
        classpath 'com.google.api-client:google-api-client:1.25.0' //<-----
        classpath 'com.google.http-client:google-http-client-jackson2:1.25.0' //<-----
        classpath 'com.google.http-client:google-http-client:1.25.0' //<-----
    }
}

and make sure that when you run ./gradlew buildEnvironment you get those specific version.

Still a problem with 2.1.0.

Alright, thank you! 😃