Failed to notify listener on project grading on Android gradle

I am trying to add a library to my project through gradle. I get an error message:

Error: Failed to notify listener on project evaluation.

Here is my build.gradle file:

apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" compileOptions.encoding = 'ISO-8859-1' defaultConfig { applicationId "br.com.myapp" minSdkVersion 14 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } repositories { jcenter() // The library owner indicates me to add the following lines maven { url 'http://clojars.org/repo' } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.1' compile 'com.android.support:design:22.2.1' compile 'com.jakewharton:butterknife:7.0.1' compile 'com.loopj.android:android-async-http:1.4.8' compile 'com.github.machinarius:preferencefragment:0.1.1' compile 'com.pavelsikun:material-seekbar-preference:0.8+' compile 'com.android.support:cardview-v7:22.0.+' compile 'com.android.support:recyclerview-v7:22.0.+' compile 'com.getbase:floatingactionbutton:1.9.0' compile files('libs/itextpdf-5.5.6.jar') compile 'json-to-pdf:json-to-pdf:0.7.5' // Here is the library that causing an error } 

The project is not syncing. I do not know how to solve this.

EDIT: here is my top gradle compilation:

 // 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' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } 
+5
source share
1 answer

Replace files with them:

  apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" compileOptions.encoding = 'ISO-8859-1' defaultConfig { applicationId "br.com.myapp" minSdkVersion 14 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.1' compile 'com.android.support:design:22.2.1' compile 'com.jakewharton:butterknife:7.0.1' compile 'com.loopj.android:android-async-http:1.4.8' compile 'com.github.machinarius:preferencefragment:0.1.1' compile 'com.pavelsikun:material-seekbar-preference:0.8+' compile 'com.android.support:cardview-v7:22.0.+' compile 'com.android.support:recyclerview-v7:22.0.+' compile 'com.getbase:floatingactionbutton:1.9.0' compile files('libs/itextpdf-5.5.6.jar') compile 'json-to-pdf:json-to-pdf:0.7.5' // Here is the library that causing an error } 

and

 buildscript { repositories { jcenter() maven {url 'http://clojars.org/repo'} } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() maven {url 'http://clojars.org/repo'} } } 
0
source

All Articles