Sikandar Ali Chishty
Sikandar Ali Chishty

Reputation: 518

Error:No such property: zipAlignEnabled for class: com.android.build.gradle.internal.variant.ApplicationVariantData

I am getting this error continuously when I try to build my old project in Android Studio 3.0

enter image description here

Here's my gradle file:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.github.triplet.gradle:play-publisher:1.1.4'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath 'com.google.guava:guava:19.0'
        classpath 'me.tatarka:gradle-retrolambda:3.3.1'
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
        flatDir {
            dirs 'libs'
        }
    }
}

Upvotes: 9

Views: 3900

Answers (2)

LONG
LONG

Reputation: 109

Because AS 3.0 uses gradle 4.1,but gradle 4.1 removed the property-- ApplicationVariantData.

So, you can downgrade your AS or set

dependencies {
  classpath 'com.android.tools.build:gradle:2.3.3'
}

on your root .gradle file

Maybe you can see this http://dev.qq.com/topic/5a0cfef91d8190380176e74d or this http://dev.qq.com/topic/59b272d9e0a78ea25114ed2a

Upvotes: -2

ddinchev
ddinchev

Reputation: 34673

For me the problem was with classpath 'com.github.triplet.gradle:play-publisher:1.1.4'. I upgraded it to com.github.triplet.gradle:play-publisher:1.2.0 and the error went away.

Upvotes: 26

Related Questions