Error: com.android.builder.dexing.DexArchiveBuilderException: Failed to process in android - java

When I am trying to run app below error occur:
Information:Gradle tasks [:app:assembleDebug]
Error:com.android.builder.dexing.DexArchiveBuilderException: Failed to process G:\Android\Fundraiser\BuyForFund\app\build\intermediates\classes\debug
Error:com.android.builder.dexing.DexArchiveBuilderException: Error while dexing App/AppController.class
Error:com.android.dx.cf.iface.ParseException: class name (app/AppController) does not match path (App/AppController.class)
Error:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process G:\Android\Fundraiser\BuyForFund\app\build\intermediates\classes\debug
AppContoller is inside java>app>AppController
Gradle.build
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.android.buyforfund"
minSdkVersion 18
targetSdkVersion 26
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.chootdev:csnackbar:1.1.0'
compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'de.hdodenhof:circleimageview:1.3.0'
}
Help me to solve this errors.

Related

Gradle sync failed: setup project failed: java.io.EOFException

I add a PrefManager file in my project to check first time login in app.After that I start sync gradle.It show me Gradle sync failed: setup project failed: java.io.EOFException error
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 27
defaultConfig {
applicationId "comviewappisome.google.sites.watchandearn"
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.android.gms:play-services-ads:17.1.2'
implementation 'com.google.firebase:firebase-core:16.0.6'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation project(':luckyWheel')
implementation 'com.google.firebase:firebase-database:16.0.5'
}

Getting a "failed to merge dex" error on Android Studio

I am a student and am stuck. I am getting this error:
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.ChangedThisforPrivacy"
minSdkVersion 22
targetSdkVersion 27
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 {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:support-v4:27.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation "com.google.android.gms:play-services:12.0.1"
}
I have tried a Clean and then Build, and the issue remains.

Android studio 3.1 failed to load aapt when running emulator

The project builds and syncs successfully but when running the project on emulator(my phone), i get the error: Failed to execute aapt, and also Caused by:java.util.NoSuchElementException.
In gradle properties is android.enableAapt2 = false
org.gradle.api.tasks.TaskExecutionException: Execution failed for
task ':app:transformDexWithInstantRunDependenciesApkForDebug'. at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at
org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at
org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at
org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at
org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at
org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at
org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at
Here is the build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.sran.dzepniprofesor"
minSdkVersion 16
targetSdkVersion 26
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 {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.android.support:design:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.android.gms:play-services-ads:12.0.1'
implementation 'com.android.support:design:26.1.0'
}
Go to preferences(settings) : click on Build,Execution,Deployment .....then select : Instant Run ......and uncheck its topmost checkbox (i.e Disable Instant Run)

DexArchiveWithExternalLibsDexMergerForDebug'. > java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

i already inserted from the build.app clean and rebuild. i dont know how to fix this problem here's my code.
My inserted code
multiDexEnabled true
compile 'com.sun.mail:javax.mail:1.6.1'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.google.android.gms:play-services:11.4.0'
Build.app
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.coorsdev.sendsms"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true //attached requires
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}dependencies {
//attached requires
compile 'com.sun.mail:javax.mail:1.6.1'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.google.android.gms:play-services:11.4.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
When it runs, this is my result from my Message.
Error:Execution failed for task
:app:transformDexArchiveWithExternalLibsDexMergerForDebug.
com.android.builder.dexing.DexArchiveMergerException: Unable to merge
dex

Build error for gradle in app

Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
java.io.IOException: Can't write [G:\new\Schat\app\build\intermediates\multi-dex\debug\componentClasses.jar] (Can't read [C:\Users\Dell.gradle\caches\transforms-1\files-1.1\support-core-ui-27.1.0.aar\56bf57c0daa4e0ce1427f0af1690a5ff\jars\classes.jar(;;;;;;**.class)] (Duplicate zip entry [classes.jar:android/support/design/widget/CoordinatorLayout$Behavior.class]))
Build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.sushem.schat"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.1'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.6.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.firebaseui:firebase-ui-database:3.2.2'
compile 'id.zelory:compressor:2.1.0'
compile 'com.android.support:multidex:1.0.2'
}
apply plugin: 'com.google.gms.google-services'
Use the last version of support library
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
Thanks everyone for helping.
The problem was with dependacy :
compile 'com.theartofdev.edmodo:android-image-cropper:2.6.0'
So i Removed it.

Categories

Resources