I have this error and I can't resolve it, I looking for interhet but not working...
Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzzf;
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "sk.tipos.paradox02.citaj"
minSdkVersion 11
targetSdkVersion 23
versionCode 26
versionName '2.0021'
}
buildTypes {
release {
minifyEnabled false
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.release
}
debug {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
// signingConfig signingConfigs.release
}
}
productFlavors {
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.google.android.gms:play-services-analytics:9.0.0'
compile 'com.google.firebase:firebase-core:9.0.0'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.firebase:firebase-ads:9.0.0'
compile 'com.google.android.gms:play-services-appindexing:9.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.gms:google-services:3.0.0'
compile 'com.google.firebase:firebase-crash:9.0.0'
compile 'com.google.firebase:firebase-ads:10.0.1'
compile 'com.android.support:design:23.0.0'
}
Error shown if I launch app. If rebuild project everything OK but when run project..
you are have several duplicate versions of library, keep only what you need nothing extra, Even after removing the duplicate libraries you are facing this error then try enabling multidex
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
...
minSdkVersion 14
targetSdkVersion 21
...
// Enabling multidex support.
multiDexEnabled true
}
...
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
in manifest inside application tag
<application
android:name="android.support.multidex.MultiDexApplication">
</application>
refer this
You've got both version 10.0.1 and 9.0.0 of 'com.google.firebase:firebase-ads'.
Remove the 10.0.1 version, as everything else is 9.0.0 and they should always have the same version.
This can be a lot of problems, but I believe this one is related to multidexing. You are enabling multidexing for the project and that's ok but this needs the multidex support library to be able to work on pre-Lolliopop.
Please add this to your dependencies
compile 'com.android.support:multidex:1.0.1'
Related
While adding below dependency in build.gradle
compile 'com.facebook.android:audience-network-sdk:4.+'
The run project is giving error
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzf.class
App, build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.xyz.abc"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
pickFirst 'META-INF/maven/com.squareup.picasso/picasso/pom.properties'
pickFirst 'META-INF/maven/com.squareup.picasso/picasso/pom.xml'
}
}
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.0.+'
compile 'com.android.support:recyclerview-v7:23.0.+'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.firebase:firebase-core:9.0.2'
compile 'com.google.firebase:firebase-messaging:9.0.2'
compile 'com.facebook.android:audience-network-sdk:4.+'
compile 'com.squareup.picasso:picasso:2.5.2'
}
apply plugin: 'com.google.gms.google-services'
What can be possible solution for it?
Try this
compile('com.facebook.android:audience-network-sdk:4.13.0')
{
exclude group: 'com.google.android.gms'
}
Update Gradle and Android Studio to latest version and it starts working.
I am getting the following error when I build my project in android studio
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/annotation/ArrayRes.class
My build.gradle file
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.android.instagram_project"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
defaultConfig {
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.1.1'
compile 'com.squareup.picasso:picasso:2.5.2'
}
This is the screenshot of my lib folder in the project
http://i.stack.imgur.com/qDjL4.jpg
Remove the Android support libraries from the libs directory. Since you are using gradle and have indicated a compile dependency with appcompat-v7 you do not need to include the JARs manually. This is causing a conflict at build time with duplicate symbols. Listing it as a compile dependency will cause gradle to work with Maven to pull the lib automatically (and its dependencies.)
for more detail look here.java.util.zip.ZipException in Android Studio
After trying my hand at a bit of programming, I wanted to run my app on my phone only to encounter this error.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_80\bin\java.exe'' finished with non-zero exit value 2
I have absolutely no idea how to tackle it. I have googled the error, which led me to this answer. I tried the method and I still encounter the error above.
This is what my Build.gradle file looks like:
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.peikle.peikle"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
dexOptions{
javaMaxHeapSize "4g"
}
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.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.parse:parse-android:1.10.3'
}
I don't know what else to include to make the picture clearer but I'd be happy to do so on request.
Addition:
I have tried cleaning the project which unfortunately didn't work out like I'd hoped. Then I followed the links provided by g2o, and Ret and tried following the instructions there. This is what my build.gradle file looks like now:
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.peikle.peikle"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
dexOptions{
javaMaxHeapSize "4g"
}
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.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.+'
Now, I'm getting this error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/parse/AbstractQueryController$1.class
It's a bit different from what I experienced before and I have no idea how to clean out this one.
I am getting started with Parse and Facebook SDK in Android Studio. I have integrated it successfully but while running the application I am getting the following error. Can anyone please help me with this. Thanks in advance.
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/parse/AbstractQueryController$1.class
Here is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "com.tanmaykulkarni.appname"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
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.0'
compile 'com.android.support:design:22.2.0'
compile 'com.jakewharton:butterknife:6.1.0'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'com.parse.bolts:bolts-android:1.3.0'
compile 'com.parse:parse-android:1.12.0'
compile 'com.parse:parsefacebookutils-v4-android:1.10.4#aar'
}
You should search for AbstractQueryController to check which dependency this class includes. Then you should update you script to ensure that this class is only included once. Do it like in the following example:
testCompile('org.robolectric:robolectric:3.0') {
//exclusions due to android.jar conflict
exclude module: 'httpclient'
exclude module: 'commons-logging'
}
i have a project with a library in libs folder.
When i run the app the android studio is give this Error:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'' finished with non-zero exit value 2
And app doesn't Run, what is the problem?
i run this app on android studio 1.2 in windows and that is fine but in android studio 1.3 on Ubuntu 14.04 with Openjdk 1.7 i have Error.
Any way to fix this?
this my Directories:
here app Build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '23.0.0'
defaultConfig {
applicationId "ir.vtj.Myapp"
minSdkVersion 9
targetSdkVersion 21
versionCode 1
versionName "1.0"
renderscriptTargetApi 18
renderscriptSupportModeEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(":sundate")
compile 'com.github.flavienlaurent.datetimepicker:library:0.0.2'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.+'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.daimajia.easing:library:1.0.0#aar'
compile 'com.daimajia.androidanimations:library:1.1.2#aar'
compile 'com.daimajia.androidviewhover:library:1.0.4#aar'
compile 'com.github.bumptech.glide:glide:3.6.0'
}
And Here Sundate Build.gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion '22.0.1'
defaultConfig {
minSdkVersion 10
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:22.2.0'
}
And Settings.gradle
include ':app'
include ':sundate'
project(':sundate').projectDir = new File('libs/sundate')