I am trying to export apk and I want to enable Proguard but it throwing below error. I read so many answers and tried but didn't worked. Getting below error:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':android:transformClassesAndResourcesWithProguardForRelease'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
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.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
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: Job failed, see logs for details
at com.android.build.gradle.internal.transforms.ProGuardTransform.transform(ProGuardTransform.java:209)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:239)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:235)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:230)
at sun.reflect.GeneratedMethodAccessor319.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:131)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
... 34 more
Caused by: java.io.IOException: java.lang.NullPointerException
at com.android.build.gradle.internal.transforms.ProGuardTransform.doMinification(ProGuardTransform.java:280)
at com.android.build.gradle.internal.transforms.ProGuardTransform.access$000(ProGuardTransform.java:67)
at com.android.build.gradle.internal.transforms.ProGuardTransform$1.run(ProGuardTransform.java:178)
at com.android.builder.tasks.Job.runTask(Job.java:47)
at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:282)
... 1 more
this is gradle file of project :
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.6'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
buildscript {
repositories {
jcenter()
google()
}
}
apply plugin: "com.android.application"
android {
buildToolsVersion '28.0.3'
compileSdkVersion 28
defaultConfig {
applicationId "..."
manifestPlaceholders = [
onesignal_app_id : '',
onesignal_google_project_number: 'REMOTE'
]
versionCode 1
versionName "1.0.1"
minSdkVersion 16
targetSdkVersion 28
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
}
signingConfigs {
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
'proguard-rules.pro'
}
}
aaptOptions {
ignoreAssetsPattern "!assets.zip"
}
aaptOptions {
cruncherEnabled = false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
configurations { natives }
dependencies {
implementation project(':core')
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
implementation "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-controllers-android:$gdxVersion"
implementation 'ir.tapsell.plus:tapsell-plus-sdk-android:1.1.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.onesignal:OneSignal:3.12.7'
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.pushpole.android:pushsdk:1.7.0'
}
task copyAndroidNatives() {
file("libs/armeabi/").mkdirs()
file("libs/armeabi-v7a/").mkdirs()
file("libs/arm64-v8a/").mkdirs()
file("libs/x86_64/").mkdirs()
file("libs/x86/").mkdirs()
configurations.getByName("natives").copy().files.each { jar ->
def outputDir = null
if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
if (jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
if (jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
if (jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
if (outputDir != null) {
copy {
from zipTree(jar)
into outputDir
include "*.so"
}
}
}
}
task run(type: Exec) {
def path
def localProperties = project.file("../local.properties")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream { instr ->
properties.load(instr)
}
def sdkDir = properties.getProperty('sdk.dir')
if (sdkDir) {
path = sdkDir
} else {
path = "$System.env.ANDROID_HOME"
}
} else {
path = "$System.env.ANDROID_HOME"
}
def adb = path + "/platform-tools/adb"
commandLine "$adb", 'shell', 'am', 'start', '-n', 'rs.pedjaapps.smc.android/rs.pedjaapps.smc.android.AndroidLauncher'
}
proguard file :
I even done this answer https://stackoverflow.com/a/41861497/5733853 but didnt correct. and more answer.
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 :)
build.gradle(module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId ""com.khaidemsandipsingha.builditbigger""
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'LICENSE.txt'
}
flavorDimensions "tier"
productFlavors {
paid {
applicationId 'com.example.khaidemsandipsingha.builditbigger.paid'
versionName '1.0-paid'
buildConfigField "boolean", "PAID_VERSION", "true"
dimension "tier"
}
free {
applicationId 'com.example.khaidemsandipsingha.builditbigger.free'
versionName '1.0-free'
buildConfigField "boolean", "PAID_VERSION", "false"
dimension "tier"
}
}
sourceSets {
main {
java.srcDirs = ['src/main/java', 'src/main/java/com.example.khaidemsandipsingha.builditbigger.paid']
}
paid {
manifest.srcFile 'src/paid/AndroidManifest.xml'
}
free {
manifest.srcFile 'src/free/AndroidManifest.xml'
}
}
repositories {
maven { url "https://maven.google.com" }
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//Tests
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
//Support
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
// Added for AdMob
freeImplementation 'com.google.android.gms:play-services:8.3.0'
//Add AndroidJoke
implementation project(':androidjoke')
//Backend
implementation project(path: ':backend', configuration: 'android-endpoints')
implementation 'com.google.api-client:google-api-client-android:1.23.0'
implementation 'com.google.api-client:google-api-client:1.23.0'
implementation 'com.android.support:multidex:1.0.3'
}
Build error output
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForFreeDebug'.
com.android.build.api.transform.TransformException: Error while generating the main dex list.
gradle build -s
Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task
':app:transformClassesWithMultidexlistForFreeDebug'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
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.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:273)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:258)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.lang.RuntimeException:
com.android.build.api.transform.TransformException: Error while
generating the main dex list.
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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
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:131)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
... 31 more Caused by: com.android.build.api.transform.TransformException: Error while
generating the main dex list.
at com.android.build.gradle.internal.transforms.D8MainDexListTransform.transform(D8MainDexListTransform.kt:127)
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)
... 47 more Caused by: com.android.builder.multidex.D8MainDexList$MainDexListException:
com.android.tools.r8.errors.CompilationError: Program type already
present: android.support.v4.graphics.drawable.RoundedBitmapDrawable
at com.android.builder.multidex.D8MainDexList.generate(D8MainDexList.java:87)
at com.android.build.gradle.internal.transforms.D8MainDexListTransform.transform(D8MainDexListTransform.kt:114)
... 50 more Caused by: com.android.tools.r8.errors.CompilationError: Program type already
present: android.support.v4.graphics.drawable.RoundedBitmapDrawable
at com.android.tools.r8.utils.ProgramClassCollection.resolveClassConflictImpl(ProgramClassCollection.java:64)
at com.android.tools.r8.utils.ProgramClassCollection.lambda$create$0(ProgramClassCollection.java:25)
at com.android.tools.r8.utils.ProgramClassCollection.create(ProgramClassCollection.java:24)
at com.android.tools.r8.graph.LazyLoadedDexApplication$Builder.build(LazyLoadedDexApplication.java:121)
at com.android.tools.r8.dex.ApplicationReader.read(ApplicationReader.java:122)
at com.android.tools.r8.dex.ApplicationReader.read(ApplicationReader.java:86)
at com.android.tools.r8.GenerateMainDexList.run(GenerateMainDexList.java:40)
at com.android.tools.r8.GenerateMainDexList.run(GenerateMainDexList.java:110)
at com.android.builder.multidex.D8MainDexList.generate(D8MainDexList.java:83)
... 51 more
GitHub project link: https://github.com/Kurosakicoder/BuildItBiggerGradle-master
what about your application class?
if you don't have one, you need to create one and put the name of it in manifest
there for your code should be like this
AndroidManifest.xml
<application
android:name="ApplicationName"
...
>
and your application class will be :
public class ApplicationName extends MultiDexApplication{
.....
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
Update
I notice that you use
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
this is not working when you run your app in debugging try you export a release if it works then you need to add these configure in a debug build type
I'd like to use a lib com.github.PhilJay:MPAndroidChart that uses jitpack repository, so My build.gradle file looks like this:
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.+'
implementation 'com.android.support:design:27.+'
implementation 'com.android.support:cardview-v7:27.+'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
}
Until yesterday everything worked good, but now I got a lot of strange errors about this jitpack. Tested to remove com.github.PhilJay:MPAndroidChart:v3.0.3 just in a clean project if we add
repositories {
maven { url 'https://jitpack.io' }
}
it will fail
Full stack trace:
> org.gradle.api.UncheckedIOException: Failed to capture snapshot of input files for task ':app:preFLAV_flavorReleaseBuild' property 'compileManifests' during up-to-date check.
at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.snapshotTaskFiles(CacheBackedTaskHistoryRepository.java:333)
at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.createExecution(CacheBackedTaskHistoryRepository.java:154)
at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.access$100(CacheBackedTaskHistoryRepository.java:61)
at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository$1.getCurrentExecution(CacheBackedTaskHistoryRepository.java:114)
at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.getStates(DefaultTaskArtifactStateRepository.java:201)
at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:86)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:53)
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: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.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:FLAV_flavorReleaseCompileClasspath'.
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:918)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1600(DefaultConfiguration.java:116)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:892)
at org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:68)
at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter$FileCollectionVisitorImpl.visitCollection(AbstractFileCollectionSnapshotter.java:70)
at org.gradle.api.internal.file.AbstractFileCollection.visitRootElements(AbstractFileCollection.java:234)
at org.gradle.api.internal.file.CompositeFileCollection.visitRootElements(CompositeFileCollection.java:185)
at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter.snapshot(AbstractFileCollectionSnapshotter.java:53)
at org.gradle.api.internal.changedetection.state.DefaultGenericFileCollectionSnapshotter.snapshot(DefaultGenericFileCollectionSnapshotter.java:38)
at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.snapshotTaskFiles(CacheBackedTaskHistoryRepository.java:331)
... 35 more
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.android.support:appcompat-v7:27.+.
Required by:
project :app
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver.resolve(DynamicVersionResolver.java:99)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyToComponentIdResolver.resolve(RepositoryChainDependencyToComponentIdResolver.java:61)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.ComponentResolversChain$DependencyToComponentIdResolverChain.resolve(ComponentResolversChain.java:149)
at org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution.DependencySubstitutionResolver.resolve(DependencySubstitutionResolver.java:46)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.SelectorState.resolveModuleRevisionId(SelectorState.java:99)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.resolveModuleRevisionId(EdgeState.java:91)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.performSelectionSerially(DependencyGraphBuilder.java:261)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolveEdges(DependencyGraphBuilder.java:226)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:143)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:109)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver.resolve(DefaultArtifactDependencyResolver.java:90)
at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolveGraph(DefaultConfigurationResolver.java:146)
at org.gradle.api.internal.artifacts.ivyservice.ShortCircuitEmptyConfigurationResolver.resolveGraph(ShortCircuitEmptyConfigurationResolver.java:73)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.resolveGraph(ErrorHandlingConfigurationResolver.java:66)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$4.run(DefaultConfiguration.java:483)
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.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:474)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:459)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1700(DefaultConfiguration.java:116)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getSelectedArtifacts(DefaultConfiguration.java:901)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:889)
... 42 more
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.android.support:appcompat-v7:27.+.
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.listModuleVersions(ErrorHandlingModuleComponentRepository.java:114)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver$VersionListResult.process(DynamicVersionResolver.java:428)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver$VersionListResult.resolve(DynamicVersionResolver.java:413)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver$RepositoryResolveState.resolve(DynamicVersionResolver.java:231)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver.findLatestModule(DynamicVersionResolver.java:140)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver.findLatestModule(DynamicVersionResolver.java:121)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver.resolve(DynamicVersionResolver.java:88)
... 65 more
Caused by: org.gradle.api.resources.ResourceException: Failed to list versions for com.android.support:appcompat-v7.
at org.gradle.api.internal.artifacts.repositories.resolver.ChainedVersionLister$1.visit(ChainedVersionLister.java:55)
at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.listVersionsForAllPatterns(ExternalResourceResolver.java:184)
at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.doListModuleVersions(ExternalResourceResolver.java:173)
at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.access$100(ExternalResourceResolver.java:90)
at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver$RemoteRepositoryAccess.listModuleVersions(ExternalResourceResolver.java:462)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$ResolveAndCacheRepositoryAccess.listModuleVersions(CachingModuleComponentRepository.java:345)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.BaseModuleComponentRepositoryAccess.listModuleVersions(BaseModuleComponentRepositoryAccess.java:45)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryCachedModuleComponentRepository$CachedAccess.listModuleVersions(InMemoryCachedModuleComponentRepository.java:87)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.listModuleVersions(ErrorHandlingModuleComponentRepository.java:111)
... 71 more
Caused by: org.gradle.api.resources.ResourceException: Unable to load Maven meta-data from https://jitpack.io/com/android/support/appcompat-v7/maven-metadata.xml.
at org.gradle.api.internal.artifacts.repositories.resolver.MavenMetadataLoader.load(MavenMetadataLoader.java:55)
at org.gradle.api.internal.artifacts.repositories.resolver.MavenVersionLister$1.visit(MavenVersionLister.java:51)
at org.gradle.api.internal.artifacts.repositories.resolver.ChainedVersionLister$1.visit(ChainedVersionLister.java:47)
... 79 more
Caused by: org.gradle.api.resources.ResourceException: Could not get resource 'https://jitpack.io/com/android/support/appcompat-v7/maven-metadata.xml'.
at org.gradle.internal.resource.ResourceExceptions.failure(ResourceExceptions.java:74)
at org.gradle.internal.resource.ResourceExceptions.getFailed(ResourceExceptions.java:57)
at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.copyToCache(DefaultCacheAwareExternalResourceAccessor.java:201)
at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.access$300(DefaultCacheAwareExternalResourceAccessor.java:55)
at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor$1.create(DefaultCacheAwareExternalResourceAccessor.java:90)
at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor$1.create(DefaultCacheAwareExternalResourceAccessor.java:82)
at org.gradle.cache.internal.ProducerGuard$AdaptiveProducerGuard.guardByKey(ProducerGuard.java:97)
at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.getResource(DefaultCacheAwareExternalResourceAccessor.java:82)
at org.gradle.api.internal.artifacts.repositories.resolver.MavenMetadataLoader.parseMavenMetadataInfo(MavenMetadataLoader.java:61)
at org.gradle.api.internal.artifacts.repositories.resolver.MavenMetadataLoader.load(MavenMetadataLoader.java:51)
... 81 more
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://jitpack.io/com/android/support/appcompat-v7/maven-metadata.xml'.
at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:96)
at org.gradle.internal.resource.transport.http.HttpClientHelper.performRawGet(HttpClientHelper.java:80)
at org.gradle.internal.resource.transport.http.HttpClientHelper.performGet(HttpClientHelper.java:84)
at org.gradle.internal.resource.transport.http.HttpResourceAccessor.openResource(HttpResourceAccessor.java:43)
at org.gradle.internal.resource.transport.http.HttpResourceAccessor.openResource(HttpResourceAccessor.java:29)
at org.gradle.internal.resource.transfer.DefaultExternalResourceConnector.openResource(DefaultExternalResourceConnector.java:56)
at org.gradle.internal.resource.transfer.ProgressLoggingExternalResourceAccessor.openResource(ProgressLoggingExternalResourceAccessor.java:36)
at org.gradle.internal.resource.transfer.AccessorBackedExternalResource.withContentIfPresent(AccessorBackedExternalResource.java:130)
at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator$11.call(BuildOperationFiringExternalResourceDecorator.java:237)
at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator$11.call(BuildOperationFiringExternalResourceDecorator.java:229)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:350)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:340)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:120)
at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator.withContentIfPresent(BuildOperationFiringExternalResourceDecorator.java:229)
at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.copyToCache(DefaultCacheAwareExternalResourceAccessor.java:199)
... 88 more
Caused by: org.apache.http.conn.ConnectTimeoutException: Connect to jitpack.io:443 [jitpack.io/104.24.23.62, jitpack.io/104.24.22.62] failed: Read timed out
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:143)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:148)
at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:126)
at org.gradle.internal.resource.transport.http.HttpClientHelper.executeGetOrHead(HttpClientHelper.java:103)
at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:94)
... 103 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.read(InputRecord.java:503)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
... 115 more
I just tested and it works. Make sure you added
maven { url 'https://jitpack.io' } under allprojects not buildscript
build.gradle(project level)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(app level)
dependencies {
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
}
If you are trying to use MPAndroidChart, you need to do the following:
In your Project level build.gradle: (project/build.gradle)
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
In your App level build.gradle: (project/app/build.gradle)
dependencies {
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
}
This library works for me.
here is my gradle
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and here is the dependencies, just look at the mpChart.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.galzaid.whatismybill"
minSdkVersion 17
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
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 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.0'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
compile 'com.android.support:design:25.3.1'
compile 'com.orhanobut:dialogplus:1.11#aar'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.afollestad.material-dialogs:core:0.9.4.5'
testCompile 'junit:junit:4.12'
}
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.