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.12k stars 340 forks source link

Existing android app using gradle-6.8-rc-1 crashed when using 3.2.0, but works fine with 2.8.0 #908

Closed pratimsc closed 3 years ago

pratimsc commented 3 years ago

Describe the bug

The android application uses the new Jetpack Compose libraries. It thus means that it has to use the JVM 11 and gradle-6.8-rc-1. The app publishing has been working alright, and still does when 2.8.0 is used. However, when the plugin is update to 3.3.0, it crashes with reported issue.

Could it be related to issues 890

The summarized error is :

To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/6.8-rc-1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build 

FAILURE: Build failed with an exception.

* What went wrong:
'void com.android.build.gradle.internal.dsl.BaseAppModuleExtension.onVariants(kotlin.jvm.functions.Function1)'

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s

How To Reproduce

Versions 3.2.0

FAILURE: Build failed with an exception.

* What went wrong:
'void com.android.build.gradle.internal.dsl.BaseAppModuleExtension.onVariants(kotlin.jvm.functions.Function1)'

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s
Gradle 6.8-rc-1

FAILURE: Build failed with an exception.

* What went wrong:
'void com.android.build.gradle.internal.dsl.BaseAppModuleExtension.onVariants(kotlin.jvm.functions.Function1)'

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s

Versions 2.8.0

\--- com.github.triplet.play:com.github.triplet.play.gradle.plugin:2.8.0
     \--- com.github.triplet.gradle:play-publisher:2.8.0
          +--- com.github.triplet.gradle:android-publisher:2.8.0
          |    +--- com.github.triplet.gradle:common-utils:2.8.0
          +--- com.github.triplet.gradle:common-utils:2.8.0
          +--- com.github.triplet.gradle:common-validation:2.8.0
Gradle 6.8-rc-1
|    +--- com.android.tools.build:gradle:3.6.3 -> 7.0.0-alpha04
+--- com.android.tools.build:gradle:7.0.0-alpha04 (*)
|    +--- com.android.tools.build:gradle:4.0.1 -> 7.0.0-alpha04 (*)

Tasks executed

Any task including ./gradlew clean would fail with error.

Expected behavior

All tasks in the project should run, and the failure should not be due to the plugin, but application code issues.

Additional context (if a crash, provide stack trace)

Add any other context about the problem here. If this bug is a crash, run the task with --stacktrace to get the full context. stacktrace.txt

SUPERCILEX commented 3 years ago

You need to use the patched version: https://github.com/Triple-T/gradle-play-publisher/releases/tag/3.2.0-agp4.2-2

pratimsc commented 3 years ago

Thanks @SUPERCILEX , this version is working as expected.

rekire commented 3 years ago

Just wondering why this is still broken in 3.4.0?

SUPERCILEX commented 3 years ago

It's not: https://github.com/Triple-T/gradle-play-publisher/issues/947#issuecomment-833584673