2017-12-08 25 views
0

Androidスタジオで署名付きAPKを生成する際に問題があります。AndroidStudioで署名されたAPKを生成できません。 'java.io.IOException'

Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. java.io.IOException: Can't write [C:\Users\Ahmed\StudioProjects\android1\app\build\intermediates\multi-dex\debug\componentClasses.jar] (Can't read [C:\Users\Ahmed.gradle\caches\transforms-1\files-1.1\support-compat-25.2.0.aar\8a6c38a056e2992b7f752213fb56ad15\jars\classes.jar(;;;;;;.class)] (Duplicate zip entry [classes.jar:android/support/v4/view/ViewCompat.class]))

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion '26.0.2' 

defaultConfig { 
    applicationId "com.ahmedkarray.switchsides.colorsdash" 
    minSdkVersion 16 
    targetSdkVersion 25 
    multiDexEnabled true 

    ndk { 
     moduleName "player_shared" 
    } 
} 

buildTypes { 
    release { 
     minifyEnabled false 
     shrinkResources false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
    } 


} 
sourceSets.main { 
    jni.srcDirs = []// <-- disable automatic ndk-build call 
} 
} 
android{ 


configurations { 
    all*.exclude group: 'com.android.support', module: 'support-v4' 
    all*.exclude group: 'com.android.support', module: 'support-annotations' 
} 
} 

dependencies { 
compile 'com.android.support:multidex:1.0.1' 
compile ('com.google.android.gms:play-services:+'){exclude module: 'support-v4'} 
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') 
compile ('com.android.support:multidex:1.0.1') 
compile 'com.android.support:support-annotations:27.0.2' 
} 

答えて

0
はcompileSdkVersion

android { 
    compileSdkVersion 27 

そして、あなたのlibsフォルダ

から support-v4-19.0.1.jarを削除するにも、このように

dependencies { 
    compile 'com.android.support:multidex:1.0.1' 
    compile ('com.google.android.gms:play-services:+'){ 
     exclude module: 'support-v4' 
    } 
    compile files('libs/dagger-1.2.2.jar') 
    compile files('libs/javax.inject-1.jar') 
    compile files('libs/nineoldandroids-2.4.0.jar') 
    compile 'com.android.support:support-v4:27.0.2' 
    compile 'com.android.support:mediarouter-v7:27.0.2' 
    compile 'com.android.support:support-compat:27.0.2' 
    compile 'com.android.support:support-core-ui:27.0.2' 
    compile 'com.android.support:appcompat-v7:27.0.2' 
    compile 'com.android.support:support-annotations:27.0.2' 
} 

の変更をあなたの依存関係を変更し

関連する問題