I am unable to find where is the issue, i shared my build.gradle file as well
Stacktrace:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithDexForDebug'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:54)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:158)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:173)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:245)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:232)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 17 more
Caused by: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
at com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:443)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:178)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:174)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
... 29 more
Caused by: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
at com.android.builder.core.DexByteCodeConverter.dexOutOfProcess(DexByteCodeConverter.java:210)
at com.android.builder.core.DexByteCodeConverter.runDexer(DexByteCodeConverter.java:159)
at com.android.builder.core.DexByteCodeConverter.convertByteCode(DexByteCodeConverter.java:146)
at com.android.builder.core.AndroidBuilder.convertByteCode(AndroidBuilder.java:1422)
at com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:272)
... 32 more
Caused by: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at com.android.builder.core.DexByteCodeConverter.dexOutOfProcess(DexByteCodeConverter.java:206)
... 36 more
Caused by: java.lang.UnsupportedOperationException
at com.android.ide.common.process.ProcessInfoBuilder$JavaProcessInfoImpl.getExecutable(ProcessInfoBuilder.java:349)
at com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:74)
at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:49)
at com.android.builder.core.DexByteCodeConverter.lambda$dexOutOfProcess$1(DexByteCodeConverter.java:196)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
... 3 more
build.gradle:
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
android {
compileSdkVersion 26
buildToolsVersion "27.0.2"
useLibrary 'org.apache.http.legacy'
lintOptions {
checkReleaseBuilds false
abortOnError false
}
aaptOptions {
cruncherEnabled = false
}
dexOptions {
preDexLibraries = false
javaMaxHeapSize "4g" // 2g should be also OK
}
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile files('libs/gcm.jar')
compile files('libs/gson-1.7.jar')
compile files('libs/acra-4.8.2.jar')
compile files('libs/mpandroidchartlibrary-2-2-4.jar')
compile files('libs/universal-image-loader-1.8.4-with-sources.jar')
compile 'me.relex:circleindicator:1.2.2#aar'
compile 'com.google.maps.android:android-maps-utils:0.5+'
compile 'com.squareup:android-times-square:1.5.0#aar'
//compile fileTree(dir: 'libs', include: ['*.jar'])
// circular loader
compile 'com.victor:lib:1.0.4'
compile ('com.google.code.gson:gson:1.7'){
exclude module: 'support-v4'
}
compile ('com.astuetz:pagerslidingtabstrip:1.0.1'){
exclude module: 'support-v4'
}
compile ('com.theartofdev.edmodo:android-image-cropper:2.6.+'){
exclude module: 'support-v4'
}
compile ('com.google.android.gms:play-services-maps:7.8.0')
{
exclude module: 'support-v4'
}
compile ('com.google.android.gms:play-services:7.8.0'){
exclude module: 'support-v4'
}
compile 'com.android.support:multidex:1.0.0'
//compile ('androidx.multidex:multidex:2.0.1')
}
Remove your gradle directory folder and sync with gradle files again.
Remove folder .gradle
Clean project
Sync with gradle files
Take a breath :)
I have imported an old project into Android Studio 3 in a MacOS.
In the past it used to compile perfect but now I am getting the following error:
Process 'command '/Users/rodrigovieira/Library/Android/sdk/ndk-bundle/ndk-build''
finished with non-zero exit value 2
The project has been imported into a different computer so I though I needed java SDK.
I have downloaded all the JDK tools.
I have check the project structure but everything seems to be setup.
The code that is giving the error is the following describing in the gradle file if a Module of the whole project:
import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
sourceSets.main.jni.srcDirs = []
sourceSets.main.jniLibs.srcDir 'src/main/libs'
task ndkBuild(type: Exec) {
workingDir file('src/main')
commandLine getNdkBuildCmd()
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}
task cleanNative(type: Exec) {
workingDir file('src/main')
commandLine getNdkBuildCmd(), 'clean'
}
clean.dependsOn cleanNative
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.protobuf:protobuf-java:3.4.0'
implementation 'com.madgag.spongycastle:core:1.51.0.0'
implementation 'com.googlecode.javacpp:javacpp:0.7'
implementation 'com.intellij:annotations:12.0'
}
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
repositories {
jcenter()
google()
}
def getNdkDir() {
if (System.env.ANDROID_NDK_ROOT != null)
return System.env.ANDROID_NDK_ROOT
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def ndkdir = properties.getProperty('ndk.dir', null)
if (ndkdir == null)
throw new GradleException("NDK location not found. Define location with ndk.dir in the local.properties file or with an ANDROID_NDK_ROOT environment variable.")
return ndkdir
}
def getNdkBuildCmd() {
def ndkbuild = getNdkDir() + "/ndk-build"
if (Os.isFamily(Os.FAMILY_WINDOWS))
ndkbuild += ".cmd"
return ndkbuild
}
Trace:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':libraries:Jumble:ndkBuild'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.process.internal.ExecException: Process 'command '/Users/rodrigovieira/Library/Android/sdk/ndk-bundle/ndk-build'' finished with non-zero exit value 2
at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:389)
at org.gradle.process.internal.DefaultExecAction.execute(DefaultExecAction.java:36)
at org.gradle.api.tasks.AbstractExecTask.exec(AbstractExecTask.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:788)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:755)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
... 33 more
Most likely, the old project does not match the new NDK. You can try to download an older version of NDK. If you want to move to the current NDK r18, start by running ndk-build from command line, with V=1 to have more diagnostic output on the screen.
Post the full log of this ndk-build V=1 here if the problems are not clear.
I have an DexArchiveMergerException when try to build SIGNED android apk. It happens only with signed apk. If I debug app or build not signed apk, everything works well.
I've already tried to clean project, invalidate cache and restart, delete build folder, but nothing helps. It's understandable that the thuth is over dependencies. And it's refers to MultiDex. But what particulary I don't know.
Can you help me with this please?
Here's my build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.incubasys.tahlilaty"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
buildConfigField "String", "SERVER_PREFIX", ""
buildConfigField "String", "SOCKET_SERVER", ""
buildConfigField "String", "SOCKET_PROTOCOL", ""
debuggable true
}
release {
buildConfigField "String", "SERVER_PREFIX", ""
buildConfigField "String", "SOCKET_SERVER", ""
buildConfigField "String", "SOCKET_PROTOCOL", ""
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
ext {
supportLibraryVersion = "28.0.0"
supportMutliDexLibraryVersion = "1.0.3"
supportDesignVersion = "1.0.0"
constraintLayoutVersion = "1.1.3"
flexBoxVersion = "1.0.0"
googleGmsServiceVersion = "16.0.1"
ciceroneVersion = "4.0.2"
rxJavaVersion = "2.1.6"
rxAndroidVersion = "2.0.1"
daggerVersion = "2.14.1"
retrofit2Version = "2.4.0"
okhttp3Version = "3.11.0"
gsonVersion = "2.8.5"
lombokVersion = "1.18.0"
androidAnnotationsVersion = "4.5.2"
accountKitVersion = "4.34.0"
firebaseCoreVersion = "16.0.4"
firebaseMessagingVersion = "17.3.4"
moxyVersion = "1.5.5"
lottieVersion = "2.7.0"
timberVersion = "4.7.1"
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.android.support:multidex:$supportMutliDexLibraryVersion"
implementation "com.android.support:recyclerview-v7:$supportLibraryVersion"
implementation "com.android.support:support-v4:$supportLibraryVersion"
implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.android.support:design:$supportLibraryVersion"
implementation "com.android.support.constraint:constraint-layout:$constraintLayoutVersion"
implementation "com.google.android:flexbox:$flexBoxVersion"
implementation "com.google.android.gms:play-services-auth:$googleGmsServiceVersion"
//Cicerone
implementation "ru.terrakok.cicerone:cicerone:$ciceroneVersion"
// RxJava and RxAndroid
implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion"
//Dagger2
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
implementation "com.google.dagger:dagger:$daggerVersion"
annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion"
//Retrofit 2
implementation "com.squareup.retrofit2:retrofit:$retrofit2Version"
implementation "com.squareup.retrofit2:converter-gson:$retrofit2Version"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit2Version"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3Version"
//Gson
implementation "com.google.code.gson:gson:$gsonVersion"
//Joda
implementation group: 'joda-time', name: 'joda-time', version: '2.9.9'
// Lombok
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
//AndroidAnnotations
annotationProcessor "org.androidannotations:androidannotations:$androidAnnotationsVersion"
implementation "org.androidannotations:androidannotations-api:$androidAnnotationsVersion"
kapt "org.androidannotations:androidannotations:$androidAnnotationsVersion"
//Account Kit
implementation "com.facebook.android:account-kit-sdk:$accountKitVersion"
//Firebase
implementation "com.google.firebase:firebase-core:$firebaseCoreVersion"
implementation "com.google.firebase:firebase-messaging:$firebaseMessagingVersion"
//Moxy
implementation "com.arello-mobile:moxy:$moxyVersion"
implementation "com.arello-mobile:moxy-android:$moxyVersion"
implementation "com.arello-mobile:moxy-app-compat:$moxyVersion"
annotationProcessor "com.arello-mobile:moxy-compiler:$moxyVersion"
implementation "com.airbnb.android:lottie:$lottieVersion"
// Timber
implementation "com.jakewharton.timber:timber:$timberVersion"
// EventBus
implementation 'org.greenrobot:eventbus:3.1.1'
testImplementation 'junit:junit:4.12'
}
And a project build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.71'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The error is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformDexArchiveWithDexMergerForRelease'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\0, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\1, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\externalLibsDexMerger\release\0
at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:212)
at sun.reflect.GeneratedMethodAccessor2143.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
... 33 more
Caused by: com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\0, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\1, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\externalLibsDexMerger\release\0
at com.android.build.gradle.internal.transforms.DexMergerTransform.transform(DexMergerTransform.java:225)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:221)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:217)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
... 48 more
Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\0, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\1, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\externalLibsDexMerger\release\0
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1431)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinTask.externalAwaitDone(ForkJoinTask.java:326)
at java.util.concurrent.ForkJoinTask.doJoin(ForkJoinTask.java:391)
at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:719)
at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:397)
at com.android.build.gradle.internal.transforms.DexMergerTransform.transform(DexMergerTransform.java:221)
... 51 more
Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\0, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\1, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\externalLibsDexMerger\release\0
at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:124)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:109)
at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:101)
at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:36)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
... 57 more
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:76)
at com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:45)
at com.android.tools.r8.D8.run(D8.java:67)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:107)
... 60 more
Caused by: com.android.tools.r8.utils.AbortException
at com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:77)
at com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:58)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:67)
... 63 more
The decision was in Lombok library: decreasing version to 1.16.20 solved the problem.
I'm taking over a project and it doesn't compile. When I build it, i got the following error:
Program type already present: com.google.gson.ExclusionStrategy
As far as i've seen, no ExclusionStrategy is used within my project. I don't really know how to figure out a solution...
Below is the full error stack.
org.gradle.api.tasks.TaskExecutionException: Execution failed for
task
':sample-mpa-ui:transformDexArchiveWithExternalLibsDexMergerForMyProjectModelDebug'.
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 org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while
merging dex archives:
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\0.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\1.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\2.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\3.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\4.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\5.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\6.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\7.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\8.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\9.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\10.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\11.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\12.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\13.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\14.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\15.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\16.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\17.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\18.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\19.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\20.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\21.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\22.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\23.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\24.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\25.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\26.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\27.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\28.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\29.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\30.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\31.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\32.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\33.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\34.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\35.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\36.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\37.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\38.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\39.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\40.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\41.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\42.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\43.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\44.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\45.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\46.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\47.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\48.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\49.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\50.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\51.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\52.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\53.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\54.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\55.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\56.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\57.jar
at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:212)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
... 32 more
Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\0.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\1.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\2.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\3.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\4.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\5.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\6.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\7.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\8.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\9.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\10.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\11.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\12.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\13.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\14.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\15.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\16.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\17.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\18.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\19.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\20.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\21.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\22.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\23.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\24.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\25.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\26.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\27.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\28.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\29.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\30.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\31.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\32.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\33.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\34.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\35.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\36.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\37.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\38.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\39.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\40.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\41.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\42.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\43.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\44.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\45.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\46.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\47.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\48.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\49.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\50.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\51.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\52.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\53.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\54.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\55.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\56.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\57.jar
at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:124)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:109)
at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:101)
at com.android.build.gradle.internal.transforms.ExternalLibsMergerTransform.transform(ExternalLibsMergerTransform.kt:123)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:221)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:217)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
... 48 more
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:76)
at com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:45)
at com.android.tools.r8.D8.run(D8.java:88)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:107)
... 53 more
Caused by: com.android.tools.r8.utils.AbortException
at com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:77)
at com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:58)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:67)
... 56 more
Below is the project's build.gradle
apply plugin: 'com.android.application'
def app_version = 'v0.0.1'
def version = '0.0.1
android {
compileSdkVersion project.ext.globalCompileSdkVersion
buildToolsVersion project.ext.globalBuildToolsVersion
defaultConfig {
applicationId "com.sample.companyname"
minSdkVersion project.ext.globalMinSdkVersion
targetSdkVersion project.ext.globalTargetSdkVersion
versionCode 74
versionName app_version
multiDexEnabled true
}
compileOptions {
//noinspection GroovyAssignabilityCheck
sourceCompatibility JavaVersion.VERSION_1_7
//noinspection GroovyAssignabilityCheck
targetCompatibility JavaVersion.VERSION_1_7
}
// This has been added to deal with a duplicate file when using
// apache commons-codec and commons-validators
packagingOptions {
pickFirst 'META-INF/DEPENDENCIES.txt'
pickFirst 'META-INF/DEPENDENCIES'
pickFirst 'META-INF/dependencies.txt'
pickFirst 'META-INF/LICENSE.txt'
pickFirst 'META-INF/LICENSE'
pickFirst 'META-INF/license.txt'
pickFirst 'META-INF/LGPL2.1'
pickFirst 'META-INF/NOTICE.txt'
pickFirst 'META-INF/NOTICE'
pickFirst 'META-INF/notice.txt'
}
signingConfigs {
debug {
//noinspection GroovyAssignabilityCheck
storeFile file('../keystore/product.keystore')
storePassword "dont"
keyAlias "even"
keyPassword "try"
}
release {
//noinspection GroovyAssignabilityCheck
storeFile file('../keystore/product.keystore')
storePassword "dont"
keyAlias "even"
keyPassword "try"
}
}
//noinspection GroovyAssignabilityCheck
buildTypes {
debug {
applicationIdSuffix ".debug"
debuggable true
}
release {
debuggable false
minifyEnabled true
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
flavorDimensions 'tier'
productFlavors {
sampleFlavor1 {
dimension 'tier'
}
sampleFlavor2 {
dimension 'tier'
}
sampleFlavor3 {
dimension 'tier'
}
sampleFlavor4 {
dimension 'tier'
}
}
sourceSets {
main.java.srcDirs = ['src/main/java']
}
lintOptions {
abortOnError false
}
}
//noinspection GroovyAssignabilityCheck
dependencies {
// Project dependencies
implementation project(':module-1')
implementation project(':module-2')
implementation project(':module-3')
implementation project(':module-4')
implementation project(':module-5')
implementation(name: 'lib-a-2.1.1-release', ext: 'aar')
implementation(name: 'lib-b-2.1.1-release', ext: 'aar')
implementation(name: 'lib-c-2.1.1-release', ext: 'aar')
implementation(name: 'lib-d-2.1.1-release', ext: 'aar')
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
implementation('commons-codec:commons-codec:1.10')
implementation('commons-validator:commons-validator:1.4.0') {
exclude group: 'commons-logging', module: 'commons-logging'
exclude group: 'commons-digester', module: 'commons-digester'
exclude group: 'commons-beanutils', module: 'commons-beanutils'
exclude group: 'commons-collections', module: 'commons-collections'
}
implementation "com.google.android.gms:play-services-nearby:$play_services_version"
implementation "com.google.android.gms:play-services-gcm:$play_services_version"
implementation 'com.android.support:multidex:1.0.3'
implementation "com.android.support:appcompat-v7:$support_version"
implementation "com.android.support:design:$support_version"
implementation "com.android.support:support-annotations:$support_version"
implementation "com.android.support.constraint:constraint-layout:1.0.2"
// Test dependencies
androidTestImplementation 'com.squareup.okhttp:mockwebserver:2.3.0'
androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.2.1'
testImplementation 'junit:junit:4.12'
}
Check if you have any gson jar in your lib folder.
I had the same problem and gson-2.2.4.jar in my lib directory.
Removing it worked for me.
Into your app level Build.gradle put a code :-
android {
defaultConfig {
multiDexEnabled true
}
}
See How to implement multiDex
Hope this helps you.
I'm trying to override bool resource using build.gradle. It overrides string resource, but it doesn't override bool resource.
How can I fix and override it?
Stacktrace is as follows:
Executing task ':app:mergeDebug2Resources' (up-to-date check took 0.102 secs) due to:
No history is available.
All input files are considered out-of-date for incremental task ':app:mergeDebug2Resources'.
Unable do incremental execution: full task run
[bool/isBeta] /builds/nao20010128nao/Wisecraft/app/src/main/res/values/booleans.xml [bool/isBeta] /builds/nao20010128nao/Wisecraft/app/build/generated/res/resValues/debug2/values/generated.xml: Error: Duplicate resources
:app:mergeDebug2Resources FAILED
:app:mergeDebug2Resources (Thread[main,5,main]) completed. Took 0.355 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebug2Resources'.
> [bool/isBeta] /builds/nao20010128nao/Wisecraft/app/src/main/res/values/booleans.xml [bool/isBeta] /builds/nao20010128nao/Wisecraft/app/build/generated/res/resValues/debug2/values/generated.xml: Error: Duplicate resources
* Try:
Run with --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDebug2Resources'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:45)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: com.android.build.gradle.tasks.ResourceException: [bool/isBeta] /builds/nao20010128nao/Wisecraft/app/src/main/res/values/booleans.xml [bool/isBeta] /builds/nao20010128nao/Wisecraft/app/build/generated/res/resValues/debug2/values/generated.xml: Error: Duplicate resources
at com.android.build.gradle.tasks.MergeResources.doFullTaskAction(MergeResources.java:185)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:88)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:244)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:231)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 57 more
Caused by: [bool/isBeta] /builds/nao20010128nao/Wisecraft/app/src/main/res/values/booleans.xml [bool/isBeta] /builds/nao20010128nao/Wisecraft/app/build/generated/res/resValues/debug2/values/generated.xml: Error: Duplicate resources
at com.android.ide.common.res2.DataSet.checkItems(DataSet.java:412)
at com.android.ide.common.res2.DataSet.loadFromFiles(DataSet.java:251)
at com.android.ide.common.res2.ResourceSet.loadFromFiles(ResourceSet.java:52)
at com.android.build.gradle.tasks.MergeResources.doFullTaskAction(MergeResources.java:164)
... 65 more
BUILD FAILED
Total time: 2 mins 0.394 secs
Stopped 0 compiler daemon(s).
And the content of build.gradle is:(Some content is truncated)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
applicationId 'com.nao20010128nao.Wisecraft'
minSdkVersion 8
targetSdkVersion 21
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles '../proguard-rules.pro'
}
debug {
applicationIdSuffix = '.alpha'
versionNameSuffix = 'd'
}
pre {
versionNameSuffix = ' Pre'
resValue "string", "app_name", "Wisecraft BETA"
resValue "bool", "isBeta", "true"
}
debug2 {
applicationIdSuffix = '.alpha'
versionNameSuffix = ' Pre'
resValue "string", "app_name", "Wisecraft BETA"
resValue "bool", "isBeta", "true"
}
}
lintOptions {
abortOnError false
}
}
dependencies {
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:multidex:+'
compile 'com.android.support:preference-v7:23.4.0'
}
In your Gradle Compile with support:multidex 1.0.1 and add also dexOptions
and packagingOptions
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
applicationId 'com.nao20010128nao.Wisecraft'
minSdkVersion 8
targetSdkVersion 21
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles '../proguard-rules.pro'
}
debug {
applicationIdSuffix = '.alpha'
versionNameSuffix = 'd'
}
pre {
versionNameSuffix = ' Pre'
resValue "string", "app_name", "Wisecraft BETA"
resValue "bool", "isBeta", "true"
}
debug2 {
applicationIdSuffix = '.alpha'
versionNameSuffix = ' Pre'
resValue "string", "app_name", "Wisecraft BETA"
resValue "bool", "isBeta", "true"
}
}
dexOptions {
//incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/NOTICE.txt' // will not include NOTICE file
exclude 'META-INF/LICENSE.txt' // will not include LICENSE file
}
lintOptions {
abortOnError false
}
}
dependencies {
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:preference-v7:23.4.0'
compile 'com.android.support:multidex:1.0.1'
}
In Your AndroidManifest.xml add this lines android:name
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:name="android.support.multidex.MultiDexApplication"
>