I just updated my build files
Gradle from 2.14.1 to 3.3 Android Plugin from 2.2.3 to 2.3.0
I am receiving the following error. Seems like some thirdparty plugin issue. Can anyone shed light to it? I cant find anything in change logs related to this change.
A problem occurred configuring project ':apis'.
Failed to notify project evaluation listener.
The "android" command is no longer included in the SDK. Any references to it (e.g. by third-party plugins) should be removed.
The build file in which error is thrown looks something like this
apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.library'
apply plugin: 'android-apt'
android {
compileSdkVersion Integer.parseInt(ANDROID_SDK_VERSION)
buildToolsVersion ANDROID_BUILD_TOOLS_VERSION
// Legacy apache network stack
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion Integer.parseInt(ANDROID_MIN_SDK_VERSION)
targetSdkVersion Integer.parseInt(ANDROID_SDK_VERSION)
consumerProguardFiles 'proguard-rules.pro'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
}
lintOptions {
abortOnError false
}
}
...
android-apt
has been deprecated and, as per the migration guide:You can remove
android-apt
and follow the migration guide to get the equivalent functionality.Similarly, as per the sdk-manager-plugin page:
So it too can be removed.
Want to summarize what it take for us to upgrade:
Upgrade to gradle 3.3 and android build tools 2.3.0
and
These should be done by Android Studio automatically when you upgrade.
Remove
android-apt
andsdk-manager-plugin
as suggested by @ianand
These plugins are deprecated and no longer needed in newer version of gradle.
Change the build tool version number in the app/build.gradle file:
Search for all
apt
in the gradle file and replace withannotationProcessor
. As an example, we are using AutoValue and Parceler and we'll have to do these:and
Finally, which is also important, clean and rebuild.