在将依赖项添加到“androidx.security:security-crypto:1.0.0-alpha02”之后,我收到错误消息“使用操作系统独立路径'build-data.properties'找到了多个文件”。我试图通过更改库的版本(1.1.0-alpha01; 1.0.0-alpha02; 1.0.0-alpha01)并修改packageoptions部分来纠正它,正如我在网上发现的那样,但没有任何效果。谢谢你的帮助。

apply plugin: 'com.android.application'

android {
compileSdkVersion 30
buildToolsVersion "30.0.1"

defaultConfig {
    applicationId "com.skcc.myapp"
    minSdkVersion 28
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

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

packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
}

}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.gms:play-services-vision:11.8.0'
implementation "androidx.security:security-crypto:1.0.0-alpha02"


//
}

最佳答案

我在Android Studio: Duplicate files copied in APK META-INF/DEPENDENCIES when compile找到了解决方案
问候

packagingOptions {
    pickFirst  '**'
}

10-02 05:59
查看更多