Gradle-play-publisher: publish task fails on gradle 4.0 and gradle plugin 3.0.0.-alpha1

Created on 23 May 2017  路  5Comments  路  Source: Triple-T/gradle-play-publisher

I'm getting the following error after I upgraded gradle to 4.0-milestone and gradle plugin to 3.0.0.-alpha1.

Looks like related to https://issuetracker.google.com/issues/38408231

Caused by: java.lang.RuntimeException: Not valid.
        at com.android.ide.common.build.ApkData.getMainOutputFile(ApkData.java:136)
        at com.android.build.gradle.internal.api.BaseVariantOutputImpl.getOutputFile(BaseVariantOutputImpl.java:60)
        at com.android.build.gradle.internal.api.ApkVariantOutputImpl_Decorated.getOutputFile(Unknown Source)
        at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.getProperty(BeanDynamicObject.java:228)
        at org.gradle.internal.metaobject.BeanDynamicObject.tryGetProperty(BeanDynamicObject.java:171)
        at org.gradle.internal.metaobject.CompositeDynamicObject.tryGetProperty(CompositeDynamicObject.java:55)
        at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:59)

Most helpful comment

I also got this error when I upgraded to Android Studio 3.0 Canary 2. The following is my workaround:

  1. Go to File > Project Structure. Click Project section
  2. Downgrade Gradle version to 3.5 and Android plugin version to 2.3.2

All 5 comments

I also got this error when I upgraded to Android Studio 3.0 Canary 2. The following is my workaround:

  1. Go to File > Project Structure. Click Project section
  2. Downgrade Gradle version to 3.5 and Android plugin version to 2.3.2

@cwliu: That doesn't work for us because we already made changes specific to the latest gradle plugin. We're also running this on CI.

@dannyroa
Here is change set that fixed same issue in our project:
https://github.com/elpassion/el-space-android/commit/f2ac5a7dd1c0c176e3444e7e87b8c851e994638a

Use build tools gradle plugin 3.0.0-alpha4.

The current version of the plugin is properly working on 3.x.y

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chrisjenx picture chrisjenx  路  5Comments

ToxicBakery picture ToxicBakery  路  4Comments

emartynov picture emartynov  路  4Comments

theunreal picture theunreal  路  3Comments

aat-antoine picture aat-antoine  路  6Comments