Multiple Dex files error. Landroid/arch/lifecycle/LiveData$1 - android

Please help me out. I have been stuck on this problem for so long. I am getting this error when I build my app
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/arch/lifecycle/LiveData$1;
Here is my app level build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.exploro.socialmediaapp"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-std=c++11"
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:27.+'
compile 'com.android.support:recyclerview-v7:27.+'
compile 'com.android.support:design:27.+'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.android.support:support-v4:27.+'
compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
compile 'com.google.firebase:firebase-storage:11.0.4'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.firebaseui:firebase-ui-database:2.2.0'
compile 'id.zelory:compressor:2.0.0'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.github.chrisbanes:PhotoView:2.0.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

Just fix firebase ui version to 3.2.2.
Change
compile 'com.firebaseui:firebase-ui-database:2.2.0'
to
compile 'com.firebaseui:firebase-ui-database:3.2.2'

Related

Multiple dex files define-volley

error when build apk....
[enter image description here][1]
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/android/volley/VolleyError;
my gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.morten.gpibwal.desakayuambon"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
}
}
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'
})
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'com.github.bumptech.glide:volley-integration:1.4.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
}
The solution is
delete "compile 'com.github.bumptech.glide:volley-integration:1.4.0'
com.android.dex.DexException: Multiple dex files define
Lcom/android/volley/VolleyError;
You should delete
compile 'com.github.bumptech.glide:volley-integration:1.4.0'
Then Clean-Rebuild-Run.
add multiDexEnabled true in gradle file also use same version for compile dependencies check below code
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.morten.gpibwal.desakayuambon"
minSdkVersion 17
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'
}
}
dexOptions {
}
}
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'
})
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'com.github.bumptech.glide:volley-integration:1.4.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.0.0'
compile 'com.android.support:design:25.0.0'
testCompile 'junit:junit:4.12'
}
remove unnecessary empty
dexOptions {
}

After Updating Android Studio 2.3.3 to 3.0 Unable to merge dex

Android Studio 3.0 Unable to merge dex after updating.
And i also tried so many old question from stackoverflow :-
Error:Execution failed for task
Android Studio 3.0 Unable to merge dex
but it not works for me.
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task
':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge
dex
And my app gradle file is give below:-
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.example"
minSdkVersion 15
targetSdkVersion 26
versionCode 5
versionName "1.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id: "One Signal Key",
onesignal_google_project_number: "REMOTE"]
}
lintOptions {
checkReleaseBuilds false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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 files('libs/acra-4.5.0.jar')
compile files('libs/signpost-commonshttp4-1.2.1.1.jar')
compile files('libs/signpost-core-1.2.1.1.jar')
compile files('libs/signpost-jetty6-1.2.1.1.jar')
compile files('libs/twitter4j-core-2.1.6.jar')
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.1.0'
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1.1#aar'
compile 'com.intuit.sdp:sdp-android:1.0.4'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.google.android.gms:play-services:11.0.2'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:customtabs:26.1.0'
compile 'com.android.support:palette-v7:26.1.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
compile 'com.github.amlcurran.showcaseview:library:5.4.3'
compile 'com.google.android.exoplayer:exoplayer:r1.5.7'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.onesignal:OneSignal:[3.6.2, 3.99.99]'
}
delete this statement:
multiDexEnabled true

Gradle MultiDex duplicate entry error

I am trying to integrate firebase into my android app, but I am receiving this error:
Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzrs.class
This is my app level build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.evan.scout"
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(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.instabug.library:instabug:2.3.1'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.google.firebase:firebase-auth:9.4.0'
compile 'com.google.firebase:firebase-config:9.4.0'
}
apply plugin: 'com.google.gms.google-services'
I do not even see a zzrs.class file
Thanks
try this:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.instabug.library:instabug:2.3.1'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.google.firebase:firebase-auth:9.4.0'
compile 'com.google.firebase:firebase-config:9.4.0'
exclude group: 'com.google.android.gms'
}

Error:Execution failed for task ':app:processDebugGoogleServices'. > No matching client found for package name com.xxx.xxx

I get and error when I try to Sync project with Gradles files
Here is the error
Error:Execution failed for task ':app:processDebugGoogleServices'.
No matching client found for package name 'ua.com.qascript.android'
And here is the Gradle file content:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
packagingOptions {
exclude('META-INF/NOTICE')
}
packagingOptions {
exclude('META-INF/LICENSE')
}
defaultConfig {
applicationId "ua.com.qascript.android"
minSdkVersion 14
targetSdkVersion 22
versionName '1.7'
versionCode 11
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/volley.jar')
compile('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: 'httpclient'
}
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
compile 'com.github.chrisbanes.photoview:library:1.2.3'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.android.support:design:24.2.1'
compile 'com.melnykov:floatingactionbutton:1.3.0'
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
Well, this error appear after I update the Google Play Services to can add Firebase Cloud Messages, it request minimum vers 9.0.
Please help me to fix it. Thanks.

Andorid - Gradle - Execution Failed For Task ':app:packageAllDebugClassesForMultiDex' Error

I'm trying to do a build clean on my Android project and when I do I end up with the error:
Execution failed for task ':app:packageAllDebugClassesForMultiDex.' > java.util.zip.ZipException: duplicate entry: com/j256/ormlite/dao/BaseDaoImpl$1.class
BUILD FAILED
Here is a current copy of my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.android.engineering"
minSdkVersion 16
targetSdkVersion 21
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
//compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.gson:gson:2.2.4'
compile 'joda-time:joda-time:2.0'
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.android.support:appcompat-v7:22.0.0'
compile files('libs/achartengine-1.1.0.jar')
compile files('libs/butterknife-5.1.2.jar')
compile files('libs/com.google.guava_1.6.0.jar')
compile files('libs/com.springsource.org.junit-4.10.0.jar')
compile files('libs/commons-collections-3.2.1.jar')
compile files('libs/dagger-1.1.0.jar')
compile files('libs/javax.inject-1.jar')
compile files('libs/opencsv-3.3.jar')
compile files('libs/ormlite-android-4.6.jar')
compile files('libs/ormlite-core-4.45.jar')
compile files('libs/log4j-1.2.16.jar')
compile files('libs/icepick-2.3.jar')
compile files('libs/mockito-core-1.9.5.jar')
}
I have tried this with the build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.android.engineering"
minSdkVersion 16
targetSdkVersion 21
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
//compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.gson:gson:2.2.4'
compile 'joda-time:joda-time:2.0'
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.android.support:appcompat-v7:22.0.0'
compile files('libs/achartengine-1.1.0.jar')
compile files('libs/butterknife-5.1.2.jar')
compile files('libs/com.google.guava_1.6.0.jar')
compile files('libs/com.springsource.org.junit-4.10.0.jar')
compile files('libs/commons-collections-3.2.1.jar')
compile files('libs/dagger-1.1.0.jar')
compile files('libs/javax.inject-1.jar')
compile files('libs/opencsv-3.3.jar')
compile files('libs/ormlite-android-4.6.jar') {
exclude group: 'BaseDoaImpl'
}
compile files('libs/ormlite-core-4.45.jar')
compile files('libs/log4j-1.2.16.jar')
compile files('libs/icepick-2.3.jar')
compile files('libs/mockito-core-1.9.5.jar')
}
When I do I get the following error: "Gradle DSL method not found: 'exclude()'
Possible causes:
- The project "project name" may be using a version of Gradle that does not contain the method.
- The build file may be missing a Gradle plugin.
Here is a current copy of my Gradle Wrapper File:
#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
How can I fix this issue? Any help would be appreciated!

Categories

Resources