2
Every time I try to introduce any API in my project and put Compile there in the dependencies of Gradle it gives error and does not come out of it.
I’ve tried synchronizing too.
The Gradle only works if I take out the API I just put in. In case I’m trying to put an API that leaves the images with circle frame.
Follows code:
Build.Radle (Module)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "E**DITADO**"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
}
Build.Radle (Application)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
}
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
If Voce has this Voce API it has to be in its folder ".. /app/libs", for this if you are using android studio, go in "project estructure/app" and in the dependencies tab add it by clicking on more and choose the option "file dependecies", if no funfar warns me that jenta tries to solve
– Armando Marques Sobrinho
@Armandomarquessobrinho, I put the API folder where you told me. I put the line there in the dependencies of Gradle, synchronized and the application ran right. But still, there in Gradle is the 3 lines in red, as in the image above. I can ignore ?
– Artur Mafezzoli Júnior
In case it does not need to have the library, since it is using the dependency by Maven. You put the mouse on top to see the error?
– Vitor Henrique
@Vitorhenrique I tried to run now and the same error appeared in Gradle. As in the image above.
– Artur Mafezzoli Júnior
Did you check if Gradle is not offline? I had a similar problem (with another lib) because of this. Check in SETTINGS -> BUILD -> GRADLE if you have marked offline, uncheck and restart AS
– Marcela Melo
@Marcelamelo I checked now and Global Gradle Settings > Offline work is unchecked. =\
– Artur Mafezzoli Júnior
Make sure it’s added:
repositories {
 mavenCentral()
}
in hisbuild.gradle
– Vitor Henrique
Check also on your other
build.gradle
(what is related to your project) if you haveallprojects {
 repositories {
 jcenter()
 }
}
– Vitor Henrique
@Vitorhenrique put the image in the question. It’s all right.
– Artur Mafezzoli Júnior
Put your two
build.gradle
complete, but copy and paste here and insert them into the code tag for us to analyze better.– Vitor Henrique
@Vitorhenrique I can’t put the code here. Exceed the limit. Prefer I put there in my question ?
– Artur Mafezzoli Júnior
Yes, edit and ask the question.
– Vitor Henrique
I put it, but it was very discombobulated. I used the code tag and it still looked like this.
– Artur Mafezzoli Júnior
tries to do so ó: creates a new project with a blank Activity and v if it runs, if it runs, Voce erases the build.Radle of that your project and copies the content of the build.Radle of that new project in it, dai vc will add the dependencies step by step, if a problem occurs, try to update your SDK
– Armando Marques Sobrinho
If your build.Radle code is the same as the one you posted there, remove the line appearance: Compile fileTree(dir: 'libs', include: ['*.jar']), as it is duplicated, leave only the first.
– Bruno Romualdo
I think I found the error I’ll post as answer.
– Bruno Romualdo
@Brunoromualdo I removed, and gives the same error. I will try to create a new project, as Armando commented
– Artur Mafezzoli Júnior