I am getting following error while building Android project in Android Studio 1.2.2 (fresh instalation)
Error:(76, 0) Could not find property 'unitTestVariants' on com.android.build.gradle.internal.dsl.TestOptions_Decorated@261be0aa.
Gradle version is 2.4
Android build gradle version is 1.2.3
Android-apt version is 1.4
Android SDK version is 19.
This is triggered by the Android apt plugin using the unitTestVariants
property in its 1.5
version which is only available in the Android gradle plugin from version 1.3
onwards (cf. bug report).
So for now either use android apt plugin version 1.4
, or Android gradle plugin version 1.3
(see instructions below).
Note that gradle version itself doesn't matter as far as this bug is concerned and you could use 2.4
as well as 2.2.1
.
1.3
buildscript
block references jcenter()
(the beta versions aren't on maven)'com.android.tools.build:gradle:1.2.3'
by 'com.android.tools.build:gradle:1.3.0-beta4'
1.4
(courtesy of @emarc-magtanong)
com.neenbedankt.gradle.plugins:android-apt:1.4
and not com.neenbedankt.gradle.plugins:android-apt:1.5
nor com.neenbedankt.gradle.plugins:android-apt:+
.