0

hi when i compile my project the error below shows up Execution failed for task for ':app:transformClassesWithMultidexlistForDebug'.

java.io.IOException: Can't write [C:\Users\user\app\app\build\intermediates\multi-dex\debug\componentClasses.jar] (Can't read [C:\Users\user\.gradle\caches\transforms-1\files-1.1\support-core-ui-25.2.0.aar\8bd3003da78946d664f3d05c69c73bfa\jars\classes.jar(;;;;;;**.class)] (Duplicate zip entry [classes.jar:android/support/v4/view/ViewPager$2.class]))>

to note i used all the answers from this Thread

+delete .Gradle Folder +Added multiDexEnabled true

but it didn't work for me

my build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        applicationId "net.amiapp.candiesstory"
        minSdkVersion 15
        targetSdkVersion 27
        multiDexEnabled true
        ndk {
            moduleName "player_shared"
        }
    }
    sourceSets {
        main {
            jniLibs.srcDir 'src/main/libs'
            jni.srcDirs = [] // レガシー ndk-build サポートを無効にする
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }



dependencies {
    implementation 'com.android.support:multidex:1.0.2'
    implementation 'com.google.android.gms:play-services-ads:11.8.0'
    implementation 'com.google.android.gms:play-services-games:11.8.0'
    implementation 'com.google.android.gms:play-services-plus:11.8.0'
    compile files('libs/dagger-1.2.2.jar')
    compile files('libs/javax.inject-1.jar')
    compile files('libs/nineoldandroids-2.4.0.jar')
    compile files('libs/support-v4-19.0.1.jar')
}
}

here the project.gradle

buildscript {
    repositories {
        mavenCentral()
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:3.1.1'
    }
}

allprojects {
    repositories {
        mavenCentral()
        google()
        maven { url "https://maven.google.com" }
        jcenter()
        maven { url "https://maven.google.com" }
    }
}
any help is appreciated , thanks in advance

1 Answers1

1

Remove these lines and delete these jar files

compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/support-v4-19.0.1.jar')

Your compileSdk is set to 27, not 19, and NineOldAndroids is a deprecated library for several years

You should also find the proper implementation dependencies for javax.inject and dagger rather than using jars

You can also remove these repos as jcenter includes Maven Central

mavenCentral()
maven { url "https://maven.google.com" }
maven { url "https://maven.google.com" }
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • hi , really thank you :) !!! you can make it as answer and thanks again –  Jan 28 '18 at 17:34
  • hi again sorry for bothering you just want to ask you if i replaced **compile files('libs/dagger-1.2.2.jar')** with compile **'com.google.dagger:dagger:2.10' annotationProcessor 'com.google.dagger:dagger-compiler:2.10'** is this the right way ? –  Jan 28 '18 at 23:23