Android - android-apt plugin is incompatible with the Android Gradle plugin. - android

I'm in the process of getting this project up to par since the Gradle update. This is a team project and it was using the android-apt plugin. I've gone through and made the necessary syntax changes (compile --> implementation & apt --> annotation processor) but the compiler is still telling me there is a discrepancy:
android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead.
Anyone have any ideas?
Thank you for any insights
-T
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '4.0.0'
def JacksonVersion = '2.6.0'
def GPSVersion = '6.5.87'
dependencies {
implementation 'com.android.support:appcompat-v7:23.0.0'
implementation 'com.android.support:design:23.0.0'
implementation 'com.android.support:recyclerview-v7:23.0.0'
implementation 'com.android.support:preference-v7:23.0.0'
implementation "com.google.android.gms:play-services-maps:$GPSVersion"
implementation "com.google.android.gms:play-services-location:$GPSVersion"
implementation 'com.facebook.android:facebook-android-sdk:4.5.0'
annotationProcessor "org.androidannotations:androidannotations:$AAVersion"
annotationProcessor "org.androidannotations:rest-spring:$AAVersion"
implementation "org.androidannotations:androidannotations-api:$AAVersion"
implementation "org.androidannotations:rest-spring-api:$AAVersion"
implementation 'org.springframework.android:spring-android-rest-template:2.0.0.M3'
}
repositories {
maven {
url 'https://repo.spring.io/libs-milestone'
}
}
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
resourcePackageName "app"
logLevel 'TRACE'
logAppenderConsole 'true'
}
}
android {
compileSdkVersion 23
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "app"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}

Try removing -
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
and
apply plugin: 'android-apt'
Annotation Processing became available in Android Gradle plugin (2.2 and later) so there is now no need / reason to provide an extra one.

Related

Could not find method implementation() for arguments [com.google.android:support-v4:r7]

I'm a total Android / Java newbie, and came across a project I want to compile below:
https://github.com/maxamillion32/Android-Firebase-mapping
It is a bit old and maybe that's why it's causing me issues.
First error I got about Build Tools 24.0.1, which I downloaded. Now I get the following error which I cannot resolve:
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method implementation() for arguments [com.google.android:support-v4:r7] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
I've checked my Dependencies in File>Project Structure and com.google.android:support-v4:r7 is there.
build.gradle (Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle (app)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.mimming.hacks.starter"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:23.4.0'
implementation 'com.google.android.gms:play-services:9.6.1'
testImplementation 'junit:junit:4.12'
// compile 'com.firebase:firebase-client-android:2.5.2+'
apply plugin: 'com.google.gms.google-services'
implementation 'com.google.firebase:firebase-database:9.6.1'
}
Any ideas?
Thank you!
The gradle version used seems to be of lower version, in-order to use implementation gradle version should be above 3
You should replace your dependencies in build.gradle to latest version.
classpath 'com.android.tools.build:gradle:3.6.3'
Also you will have to upgrade the distributionUrl also
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
As you already mentioned you have updated the buildToolsVersion, this should work fine and also make sure all the dependencies are using implementation and not compileas compile is deprecated.

Android R8 Unable to find method

I have two problems. I am unable to build a release apk either way. When I disable R8 (preferring proguard), the build just goes on forever (sometimes crashing, citing 'out of memory: java heap space'), and when I enable R8, I get the following error:
Unable to find method 'com.android.tools.r8.CompatProguardCommandBuilder.setProguardSeedsConsumer(Lcom/android/tools/r8/StringConsumer;)Lcom/android/tools/r8/R8Command$Builder;'.
My project level build.gradle:
buildscript {
repositories {
google()
mavenLocal()
jcenter()
maven { url "https://maven.google.com" }
maven { url 'http://storage.googleapis.com/r8-releases/raw' }
}
dependencies {
classpath 'com.android.tools:r8:1.5.68'
classpath 'com.android.tools.build:gradle:3.6.0-alpha09'
classpath 'com.google.gms:google-services:4.3.1'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.7.3'
}
}
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
}
repositories {
google()
mavenLocal()
jcenter()
maven { url "https://maven.google.com" }
}
apply plugin: "com.jfrog.artifactory"
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And my project module build.gradle:
apply plugin: 'com.android.application'
android {
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/DEPENDENCIES'
}
compileSdkVersion 29
buildToolsVersion '29.0.2'
defaultConfig {
applicationId "XXX"
minSdkVersion 19
targetSdkVersion 29
vectorDrawables.useSupportLibrary = true
signingConfig signingConfigs.release
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles 'proguard.cfg'
}
}
productFlavors {}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
ignoreWarnings true // false by default
quiet true // false by default
abortOnError false
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
api project(':Tableview')
implementation 'com.diogobernardino:williamchart:2.5.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.squareup.okhttp3:okhttp:4.1.0'
implementation 'com.squareup.okio:okio:2.4.0'
implementation 'com.google.android.material:material:1.1.0-alpha09'
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta03'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.emoji:emoji:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.0.0'
implementation 'androidx.media:media:1.1.0-rc01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.fasterxml.jackson.core:jackson-core:2.10.0.pr1'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.10.0.pr1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.10.0.pr1'
implementation 'commons-io:commons-io:2.6'
implementation 'org.apache.commons:commons-lang3:3.9'
implementation 'org.apache.commons:commons-text:1.6'
implementation 'petrov.kristiyan:colorpicker-library:1.1.10'
implementation 'com.google.android.libraries.places:places:2.0.0'
}
apply plugin: 'com.google.gms.google-services'
gradle.properties:
android.enableJetifier=true
artifactory_user=admin
android.useAndroidX=true
android.enableBuildCache=true
org.gradle.jvmargs=-Xmx1g
Both the jvmargs and dexOptions heap size were put there as an attempt to fix the 'java heap space' problem, which they did not.
Removing the line classpath 'com.android.tools:r8:1.5.68' should solve the problem, as that will make the Android Gradle Plugin use the version of R8 which it has built-in.
The issue is that you are using an R8 distribution version 1.5.68 (classpath 'com.android.tools:r8:1.5.68') together with the Android Gradle Plugin version 3.6.0-alpha09 (classpath 'com.android.tools.build:gradle:3.6.0-alpha09'). The API that is missing was introduced in version 1.6.x of R8 (this CL).

Gluon Mobile: using ExoPlayer

I am working on an android app with GluonMobile. For one feature I need a ExoPlayer.
So I included the dependency com.google.android.exoplayer:exoplayer:+ .
It seems that the dependecy is an aar -file and InteliJ could not find any of ExoPlayers classes.
Here my buildscript:
buildscript {
repositories {
mavenCentral()
jcenter()
google()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:+'
classpath 'com.github.jengelman.gradle.plugins:shadow:+'
}
}
apply plugin: 'org.javafxports.jfxmobile'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'
apply plugin: 'idea'
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
repositories {
mavenCentral()
jcenter()
google()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
maven {
url uri('libs')
}
}
mainClassName = '[...].main.Main'
version = '2.0_Alpha'
dependencies {
compile "com.gluonhq:charm:+"
compile "com.gluonhq:glisten-afterburner:+"
compile "com.google.apis:google-api-services-youtube:+"
compile "com.google.api-client:google-api-client-java6:+"
compile "com.google.oauth-client:google-oauth-client-jetty:+"
compile "com.google.code.gson:gson:+"
compileOnly 'lib.idea:annotations:0'
androidImplementation "org.javafxports:jfxdvk:+"
androidImplementation 'com.google.android.exoplayer:exoplayer:+#aar'
}
jfxmobile {
downConfig {
version = '+'
// Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
//noinspection GroovyAssignabilityCheck
plugins 'browser', 'display', 'lifecycle', 'statusbar', 'storage'
}
android {
manifest = 'src/android/AndroidManifest.xml'
//androidSdk = "${ANDROID_HOME}"
compileSdkVersion = 28
targetSdkVersion = 22
minSdkVersion = 16
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
}
task installApk{
group = "gluon mobile for android"
doLast{
exec {
workingDir "${ANDROID_HOME}\\platform-tools"
commandLine "${workingDir}\\adb.exe", "install", "${buildDir}/javafxports/android/YouJavaTubeApp.apk"
}
}
}
I found already something about explodeAarDependencies(...) but it did not work. So have somebody any ideas how to include (any) aar dependencies to my GluonMobile project.
Thank you for your help.
You are on the right track about explodeAarDependencies, this is the task used by the jfxmobile plugin to unpack .aar dependencies into .jar and other resources.
You can find about the task here.
How to use it:
In your build.gradle file, include the dependency:
dependencies {
...
androidCompile 'com.google.android.exoplayer:exoplayer:2.9.0'
}
Note 1: don't to use #aar
Note 2: the jfxmobile plugin uses some defined configurations like androidCompile instead of androidImplementation.
Note 3: I'd rather use the given version, not +.
And at the end of the file, add the task:
project.afterEvaluate {
explodeAarDependencies(project.configurations.androidCompile)
}
And that's it.
Save and apply/sync/reload the build and you should see exoplayer and a bunch of transitive dependencies included into the Android compile dependencies, both .aar and .jar files.
I think you are adding dependencies in the wrong gradle file.
There will be 2 gradle files , One for project level and for app level. you need to add your libraries dependencies in app level gradle.
whereas you might be adding in the project level gradle.
My Gradle file looks like this :
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.3"
defaultConfig {
applicationId "my.application.id"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.google.android.exoplayer:exoplayer:2.9.0'
}
For more details on adding exoplayer pls refer to
Github and
https://developer.android.com/guide/topics/media/exoplayer

The project is not a Gradle-based project. How do I open the project from the root directory?

I've been having this issue for a while and have been racking my brain.
I googled this answer here
Which the response is "Make sure you open the project from its root directory. i.e. the directory which contains the top level build.gradle file."
My question is: How the do I do that if I cloned the project from bitbucket?
Here's a screenshot of my file tree:
Thank you for any insights
Edit: Gradle files
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
allprojects {
repositories {
jcenter()
}
}
app level:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '4.0.0'
def JacksonVersion = '2.6.0'
def GPSVersion = '6.5.87'
dependencies {
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:preference-v7:23.0.0'
}
repositories {
maven {
url 'https://repo.spring.io/libs-milestone'
}
}
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
resourcePackageName "appname"
logLevel 'TRACE'
logAppenderConsole 'true'
}
}
android {
compileSdkVersion 23
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "appname"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
Your project is not Gradle based because settings.gradle and bulid.gradle are not in the IDE project directory, they are in that blacked-out subfolder under .idea and .gradle in your picture.
You must close this project. Open that other folder as an Android Studio Project, regardless of where you got that project from.
For library projects in Github, it would look like this. Anyone can clone this as-is and open as a project.
For apps, replace sample with app, and remove library
Most importantly, buildscript and allprojects section should not be in /app/build.gradle, only /build.gradle
Additionally, your Gradle build plugin is outdated
The top level should look like this:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The app level file should look like this:
apply plugin: 'com.android.application'
def AAVersion = '4.0.0'
def JacksonVersion = '2.6.0'
def GPSVersion = '6.5.87'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) //This is where your JARs go
implementation 'com.android.support:appcompat-v7:23.0.0'
implementation 'com.android.support:design:23.0.0'
implementation 'com.android.support:recyclerview-v7:23.0.0'
implementation 'com.android.support:preference-v7:23.0.0'
}
repositories {
maven {
url 'https://repo.spring.io/libs-milestone'
}
}
android {
compileSdkVersion 23
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "appname"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
You need to remove the android-apt plugin from it because the functionality is already included. If you later run into trouble, check this question.

Android Studio won't compile org/codehaus/groovy/runtime/StringGroovyMethods

Android Studio gradle is getting a groovy error as follows:
Error:(36, 0) Cause: org/codehaus/groovy/runtime/StringGroovyMethods
Open File
Haven't been able to resolve this for the most current version of Android Studio Canary version. I have added
classpath 'org.codehaus.groovy:groovy-backports-compat23:2.3.5'
to the Project: build.gradle and I still have an issue, seems like something has a compatibility issues, but not sure what.
Here's some of my version info:
AI-141.2071668 (latest canary build)
Plugins
Android Support Version: 10.1.3 RC 1
Groovy Version: 9.0
Java:
jdk1.7.0_79 and jdk1.7.0_17 (tried both)
Here are my gradle files:
Project: build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'org.codehaus.groovy:groovy-backports-compat23:2.3.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
My gradle-wrapper.properties file:
#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-2.2.1-all.zip
My application build.gradle file:
buildscript {
repositories {
mavenCentral()
}
dependencies {
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId 'com.me.app'
minSdkVersion 16
targetSdkVersion 21
versionCode 1101
versionName "1.1.01"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/ASL2.0'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
productFlavors {
developercode {
minSdkVersion 16
applicationId 'com.me.app'
targetSdkVersion 21
versionCode 1101
versionName '1.1.01'
}
eridesharecode {
minSdkVersion 16
applicationId 'com.me.app'
targetSdkVersion 21
versionCode 1101
versionName '1.1.01'
}
}
dexOptions { javaMaxHeapSize "2g" }
compileOptions {
encoding "UTF-8"
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':library')
compile 'com.android.support:support-v4:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
compile 'com.squareup.okio:okio:1.1.0'
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'de.keyboardsurfer.android.widget:crouton:1.+#aar'
compile 'com.joanzapata.android:android-iconify:1.0.6'
compile 'com.tundem.aboutlibraries:library:4.0.1#aar'
compile 'com.squareup.retrofit:retrofit:1.7.1'
provided 'com.squareup.dagger:dagger:1.2.+'
compile 'com.google.android.gms:play-services:+'
compile 'cn.pedant.sweetalert:library:1.3'
compile 'de.greenrobot:eventbus:2.1.0'
compile files('libs/nineoldandroids-2.4.0.jar')
provided 'com.squareup.dagger:dagger-compiler:1.2.+'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.joanzapata.mapper:simple-mapper:1.0.10'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.google.maps.android:android-maps-utils:0.3+'
compile 'javax.mail:mail:1.4.7'
}
I have also cleaned out my .gradle folder, *.iml, build folders ... again to no resolution.
I have been able to downgrade Android Studio to version 141.1903250 and it works, but I like to take advantage of the newest Android Studio versions, when they don't break anything.
I did two things to resolve the issue. Add the groovy compile to the build.gradle files and used a older version of gradle.
I change the Project build.gradle file to the folloiwng:
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
I changed the module build.gradle file as follows:
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
// classpath 'com.android.tools.build:gradle:0.10.+'
// classpath 'com.uphyca.gradle:gradle-android-aspectj-plugin:0.9.8'
// classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
}

Categories

Resources