I have a "META-INF/androidx.legacy_legacy-support-core-utils.version"Error . How can ı solve my problem

huangapple go评论78阅读模式
英文:

I have a "META-INF/androidx.legacy_legacy-support-core-utils.version"Error . How can ı solve my problem

问题

当我想生成已签名的APK文件时,我遇到了“META-INF/androidx.legacy_legacy-support-core-utils.version”错误。
我该如何解决这个问题。

Build Gradle(app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.0"

    defaultConfig {
        applicationId "com.viadom"
        minSdkVersion 19
        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 true
            signingConfig signingConfigs.debug
        }
    }
}

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

注意:如果您需要进一步的帮助,请随时提问。

英文:

When I want get generate singed apk then I have "META-INF/androidx.legacy_legacy-support-core-utils.version" error .
How can ı solve my problem .

Build Gradle(app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.0"

    defaultConfig {
        applicationId "com.viadom"
        minSdkVersion 19
        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 true
            signingConfig signingConfigs.debug
        }
    }
}

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

}

答案1

得分: 0

Sure, here's the translated content:

在你的 build.gradle 文件的 android 块下添加 packageOptions。

android {
   
   ...

   packagingOptions {
        pickFirst 'META-INF/androidx.legacy_legacy-support-core-utils.version'
   }

}
英文:

add packageOptions to you build.gradle file under android block.


android {
   
   ...

   packagingOptions {
        pickFirst 'META-INF/androidx.legacy_legacy-support-core-utils.version'
   }

}

huangapple
  • 本文由 发表于 2020年9月24日 14:12:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/64040488.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定