Triple-T / gradle-play-publisher

GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
MIT License
4.13k stars 341 forks source link

Failed to build the project. #771

Closed DenK91 closed 4 years ago

DenK91 commented 4 years ago

Describe the problem

At the last week everything was fine, project was built well on February 14, 2020. But on the morning of Monday February 17, failed to build the project. Were not any changes in my code. Please help, What I do wrong? Advice in google and on stackoverflow regarding this problem don't helped me.

How To Reproduce

The library is setup as follows:

my root build.gradle

buildscript {

    ext.kotlin_version = '1.3.61'
    ext.navigationVersion = '1.0.0'

    repositories {
        google()
        jcenter()
//        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:$navigationVersion"
        classpath 'com.github.triplet.gradle:play-publisher:2.7.0-SNAPSHOT'
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'io.fabric.tools:gradle:1.31.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

app/build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'androidx.navigation.safeargs.kotlin'
apply plugin: "com.github.triplet.play"
apply plugin: 'io.fabric'

android {
    *******
    playConfigs {
        release {
            serviceAccountCredentials = file("Project-publisher.json")
        }
        staging {
            serviceAccountCredentials = file("Project-Stage-publisher.json")
        }
    *******
    }
    dependencies {}
play {
    track = "internal"
    releaseStatus = "completed"
    resolutionStrategy = "ignore"
}

I tried some gradle wrappers but was the same behavior: distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip

Actual behavior

I get failure build, but if I commenting plugin in my app/build.gradle project builds fine.

Additional context (if a crash, provide stack trace)

Unable to load class 'com.android.Version'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
SUPERCILEX commented 4 years ago

Oh, bummer that you're getting such an unhelpful error. It should say that the minimum Android Gradle Plugin version is 3.6.0. Since it hasn't shipped yet, you can use 3.6.0-rc03: classpath 'com.android.tools.build:gradle:3.6.0-rc03'.

SUPERCILEX commented 4 years ago

See 983a42aa76ada78e5159e2651cc31e2a4fa1bbf8 for the new AGP requirement and a6473a5eaa10171849ef13724a47bd3e0df74656 for the new Gradle requirement.

DenK91 commented 4 years ago

Yes it was help me. Just I don't used to candidate versions, but in this case it normal for me. Thanks!