0
I have this error in my Android Studio, this happens when I run an application I am developing. Does anyone know what it can be?
Follow my build.Radle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "android.com.br.apptoner"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile files('libs/gson-2.3.1.jar')
compile files('libs/retrofit-2.0.0.jar')
compile 'com.squareup.retrofit2:retrofit:2.0.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
}
Try adding this in the build.Gradle file: defaultConfig { multiDexEnabled true }
– Geferson
This error appeared after I put the command you suggested: "Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.Transform.Transformexception: java.util.zip.Zipexception: Duplicate entry: retrofit2/Builtinconverters$Bufferingresponsebodyconverter.class"
– Clicnet
Post the build.Radle file.
– Geferson
@Geferson posted
– Math
First part of Gradle: apply plugin: 'com.android.application' android {
 compileSdkVersion 23
 buildToolsVersion "23.0.2"

 defaultConfig {
 applicationId "android.com.br.apptoner"
 minSdkVersion 16
 targetSdkVersion 23
 versionCode 1
 versionName "1.0"
 multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-Rules.pro' } } }
– Clicnet
Replace this line : Compile files('libs/gson-2.3.1.jar') with this 'com.google.code.gson:gson:2.3.1' and remove this Compile files('libs/retrofit-2.0.0.jar'), see if it works. Don’t forget to clean up and build on the project.
– Geferson
Where I find the option to "clean and build" in android studio?
– Clicnet
It is in the top bar the Build icon, but you can use the shortcut Ctrl+F9.
– Geferson
Related or not, it’s probably a good idea to install JDK 7, which is the largest version of Java with Android support.
– Pablo Almeida
I upgraded pro jdk8 thinking it might be problems in java, but I’ll still try JDK7 again.
– Clicnet
I already have more than a week crashing with errors in this android studio, getting out of one problem and entering another. Meanwhile my project stopped.
– Clicnet