I am trying to build my app on android studio virtual simulator, I have successfully tested on api level 21 and above now I am testing lower level api 19, but whenever I run i will get this error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/android/volley/Request$Priority.class
This is my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'dev.dworks.libs:volleyplus:0.1.4'
compile 'com.squareup.okhttp3:okhttp:3.5.0'
compile 'com.google.android.gms:play-services-gcm:10.0.1'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile 'com.android.support:design:25.1.0'
compile 'com.roughike:bottom-bar:1.2.1'
compile 'com.ncapdevi:frag-nav:1.2.2'
compile 'me.dm7.barcodescanner:zxing:1.8.4'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'net.gotev:uploadservice:3.0.3'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.journeyapps:zxing-android-embedded:3.4.0'
compile 'com.ogaclejapan.smarttablayout:library:1.6.1#aar'
compile 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1#aar'
compile 'com.hedgehog.ratingbar:app:1.1.2'
testCompile 'junit:junit:4.12'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
}
apply plugin: 'com.google.gms.google-services'
I have found many solution online regarding this but not specifically to this issue, I believe the problem is with volley, but I cannot remove any library due to my code. How should I solve this issue? Thank you!
You are using 2 different versions of volley libraries
compile 'com.android.volley:volley:1.0.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
use any one of the above
and I dont know about
compile 'dev.dworks.libs:volleyplus:0.1.4'
If that is similar library to above two ,the error will still remain
Related
I'm running an android react native app and a successfull build is completed, but when the app is launched it crashes, I can't even open it. I've tried multiple solutions I find on the internet, but none seem to work.
Here are my gradle files:
gradle.app
apply plugin: "com.android.application"
import com.android.build.OutputFile
project.ext.react = [
nodeExecutableAndArgs : ["/usr/local/bin/node"]
];
apply from: "../../node_modules/react-native/react.gradle"
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 26
buildToolsVersion '26.0.1'
defaultConfig {
applicationId "com.tradeup"
minSdkVersion 16
targetSdkVersion 26
versionCode 3
versionName "1.7"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
}
dependencies {
compile project(':react-native-fcm')
compile project(':react-native-code-push')
compile project(':react-native-image-picker')
compile project(':react-native-splash-screen')
compile (project(':react-native-fcm')){
exclude group: "com.google.firebase"
}
compile project(':react-native-svg')
compile project(':react-native-vector-icons')
compile project(':react-native-linear-gradient')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+"
compile "com.google.firebase:firebase-core:11.2.0"
compile "com.google.android.gms:play-services-base:11.2.0"
compile "com.google.firebase:firebase-analytics:11.2.0"
compile "com.google.firebase:firebase-auth:11.2.0"
compile "com.google.firebase:firebase-config:11.2.0"
compile "com.google.firebase:firebase-crash:11.2.0"
compile "com.google.firebase:firebase-database:11.2.0"
compile "com.google.firebase:firebase-messaging:11.2.0"
compile "com.google.firebase:firebase-perf:11.2.0"
compile "com.google.firebase:firebase-storage:11.2.0"
}
apply plugin: 'com.google.gms.google-services'
I've been trying to fix this for a while now, and the ios version runs fine. Thanks.
This is due to different libraries are trying to use different gms service's version. Try with this in your build.gradle file -
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.getRequested().getGroup() == 'com.google.android.gms') {
details.useVersion('x.x.x') // here should be your version ---> details.useVersion('15.0.1') //the latest one
}
}
}
dependencies {
compile project(':react-native-fcm')
compile project(':react-native-code-push')
compile project(':react-native-image-picker')
compile project(':react-native-splash-screen')
compile (project(':react-native-fcm')){
exclude group: "com.google.firebase"
}
compile project(':react-native-svg')
compile project(':react-native-vector-icons')
compile project(':react-native-linear-gradient')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+"
compile "com.google.firebase:firebase-core:11.2.0"
compile "com.google.android.gms:play-services-base:11.2.0"
compile "com.google.firebase:firebase-analytics:11.2.0"
compile "com.google.firebase:firebase-auth:11.2.0"
compile "com.google.firebase:firebase-config:11.2.0"
compile "com.google.firebase:firebase-crash:11.2.0"
compile "com.google.firebase:firebase-database:11.2.0"
compile "com.google.firebase:firebase-messaging:11.2.0"
compile "com.google.firebase:firebase-perf:11.2.0"
compile "com.google.firebase:firebase-storage:11.2.0"
}
I added this to gradle and it solved my problem
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.android.gms:play-services-gcm:15.0.1"
I'm struggling to make my app work after i added Facebook login with Firebase.
I've been having different issues however all of them are about versions and change something in manifest data. The last issue that i got was:
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute meta-data#com.facebook.sdk.ApplicationId#value
value=(#string/facebook_app_id) from AndroidManifest.xml:23:13-52 is
also present at [com.firebaseui:firebase-ui-auth:2.3.0]
AndroidManifest.xml:24:13-60 value=(#string/facebook_application_id).
Suggestion: add 'tools:replace="android:value"' to
element at AndroidManifest.xml:22:9-23:54 to override.
I have already tried to change and add the metada tag however it has not worked.
My Gradle file is like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "br.sosqueen.com.sosqueen"
minSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//General
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.android.support:design:25.0.0'
// Firebase UI Database
compile 'com.firebaseui:firebase-ui-database:3.1.0'
//Google Play Services
compile 'com.google.android.gms:play-services-auth:11.2.0'
//Firebase
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-storage:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.google.firebase:firebase-core:11.8.0'
//Facebook Login
compile 'com.facebook.android:facebook-login:[4,5)'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
I know that i am using lots of dependencies however i do need them all.
Can anybody help me, please?????
This is better than
buildToolsVersion "26.0.2"
buildToolsVersion '27.0.3'
//Firebase
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.firebaseui:firebase-ui-database:3.2.2'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
Visit this page to check the correct Facebook configuration, such as retail keys and so on:
https://developers.facebook.com/docs/facebook-login/android
From the last few hours I'm trying to resolve this problem.
These errors came after updating the dependencies. The error I'm getting here is :
Execution failed for task app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
This is my build.gradle
apply plugin: 'com.android.application'
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 25
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.lavazza"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
allprojects {
repositories {
mavenCentral()
}
}
dexOptions {
incremental = true;
preDexLibraries = false
javaMaxHeapSize "2g"
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.3-alpha', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// Glide image library
//SUB-DEPENDENCIES
//Android-Iconics - used to provide an easy API for icons
compile files('libs/httpclient-4.5.3.jar')
compile files('libs/commons-codec-1.9.jar')
compile files('libs/commons-logging-1.2.jar')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:design:25.4.0'
compile 'com.android.support:recyclerview-v7:25.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:cardview-v7:25.4.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.volley:volley:1.1.0-rc1'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.jpardogo.materialtabstrip:library:1.0.9'
compile 'com.android.support:multidex:1.0.2'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:support-v4:25.4.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.17'
compile 'com.google.android.gms:play-services:11.6.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5#aar'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
compile 'com.mikepenz:actionitembadge:3.3.1#aar'
compile 'com.mikepenz:iconics-core:2.8.1#aar'
compile 'com.github.rey5137:material:1.2.2'
compile 'com.android.support:mediarouter-v7:25.4.0'
testCompile 'junit:junit:4.12'
}
I've checked most of the SO answers for this issue, but nothing worked for me.
I've already tried the following:
1. clean and rebuild the project.
2. MultidexEnable is already true.
3. Invalidate cache and restart the Android studio.
Before marking it as a duplicate, please solve the issue for me.
I got stuck here.
I had similar issues and here is how I fixed it:
Check for upgrades to Android Studio and update to the latest version.
Add implementation 'com.android.support:design:27.1.0' to your app level build.gradle file.
Clean project and then rebuild.
Hope that helps!
Spent almost a day searching the issue but no luck.Its due to the redundancy of dependencies.Which one is repeated couldn't find yet.
here in my build.gradle file
apply plugin: 'com.android.application'
android {
defaultConfig {
applicationId "com.ujjwalmainali.univhub"
minSdkVersion 16
targetSdkVersion 22
versionCode 8
versionName "1.1"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
configurations {
all*.exclude group: 'commons-logging', module: 'commons-logging'
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/ECLIPSE_.SF'
exclude 'META-INF/ECLIPSE_.RSA'
}
compileSdkVersion 25
buildToolsVersion '25.0.2'
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven { url "https://raw.githubusercontent.com/smilefam/SendBird-SDK-
Android/master/" }
}
dependencies {
testCompile 'junit:junit:4.12'
//iconify dependencies
compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2' // (v4.5)
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.sendbird.sdk:sendbird-android-sdk:3.0.25'
compile 'com.miguelcatalan:materialsearchview:1.4.0'
compile 'net.gotev:uploadservice-okhttp:3.0.3'
compile 'com.jaredrummler:material-spinner:1.1.0'
compile 'com.nononsenseapps:filepicker:4.1.0'
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.0'
compile 'cn.pedant.sweetalert:library:1.3'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'io.github.kobakei:ratethisapp:1.2.0'
compile 'com.github.paolorotolo:appintro:4.1.0'
//webview
compile 'com.thefinestartist:finestwebview:1.2.7'
//for android drawer
compile('com.mikepenz:materialdrawer:5.8.1#aar') {
transitive = true
}
compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.10.4#aar'){
transitive=true
}
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.5.3'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.googlecode.json-simple:json-simple:1.1'
compile 'com.ogaclejapan.smarttablayout:library:1.6.1#aar'
compile 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1#aar'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'commons-validator:commons-validator:1.4.1'
//for the calender date picker supports other type picker also like radial time picker,recurrence picker
compile 'com.code-troopers.betterpickers:library:3.1.0'
compile 'com.mikepenz:actionitembadge:3.3.1#aar'
compile 'com.mobsandgeeks:android-saripaar:2.0.1'
compile 'com.nightonke:boommenu:2.0.9'
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-maps:9.2.0'
compile 'com.google.android.gms:play-services-places:9.2.0'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:cardview-v7:25.0.0'
//circular progress bar
compile 'com.victor:lib:1.0.4'
//app crash report
compile 'ch.acra:acra:4.9.0'
ext.googlePlayServicesVersion='10.0.1'
ext.supportLibraryVersion='23.1.1'
provided 'org.glassfish:javax.annotation:10.0-b28'
apply plugin: 'com.google.gms.google-services'
}
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/commons/collections/ArrayStack.class
compile 'commons-validator:commons-validator:1.4.1'
The commons-validator dependency contains two versions of ArrayStack, because of a transitive dependency it has on commons-collections.
By excluding commons-collections in the declaration, you're effectively removing all classes associated with that library and what remains is only one ArrayStack class at runtime.
compile('commons-validator:commons-validator:1.4.1') {
exclude module: 'commons-collections'
}
In my case following solution work for me:
Just added in myProject/app/build.gradle inside android{}
configurations {
all*.exclude group: 'commons-collections', module: 'commons-collections'
}
And then: Sync -> Clean -> Rebuild, Project
i have this error :
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl.class
on this build.gradle app :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.mtma.mytripmyadventure"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile('com.android.support:support-v4:23.4.0') {
force = true;
}
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.roughike:bottom-bar:1.2.1'
compile 'com.google.android.gms:play-services-maps:9.8.0'
compile 'com.android.support:support-v4:23.4.0'
}
i have try many things to do but the result still the same
i have add all*.exclude group: 'com.android.support', module: 'support-v4'
but still error
help me to resolve this.. icant resolve it in 1 day
thx stackoverflow
I had a similar issue, I was importing
compile fr.avianey.com.viewpagerindicator:library:2.4.1.1'
and had to add "#aar" termination
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1.1#aar'
That error in your latest comment is completely different as it relates to an XML issue in your Activity.
You do not need the support-v4 dependency explicitly. It is included with the v7 dependency. That being said, definitely do not need to force = true on it
The solution to the first error is remove both dependencies of compile 'com.android.support:support-v4
This has worked for me.
compile('com.jakewharton:butterknife:8.5.1') {
exclude module: 'support-compat'
}