首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >生成有符号APK时,"androidx.legacy_legacy-support-core-utils.version发生碰撞“错误”。

生成有符号APK时,"androidx.legacy_legacy-support-core-utils.version发生碰撞“错误”。
EN

Stack Overflow用户
提问于 2020-06-15 08:15:20
回答 2查看 5.6K关注 0票数 5

在尝试生成签名的APK时,它显示了以下错误消息。

'META-INF/androidx.legacy_legacy-support-core-utils.version‘条目名与碰撞

在此之前,它已经正常工作了几年。此外,我在另一台PC上签了同样的安卓工作室和相同的分级版本,它在那台电脑上工作正常。我正在经历这个问题,特别是一个个人电脑本身,为什么?我已经附上了下面的build.gradle。

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 29

    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 29
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        vectorDrawables {
            useSupportLibrary = true
        }
    }

        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }


    //--Test
    lintOptions {
        checkReleaseBuilds false
    }



    flavorDimensions "default"



    buildTypes {
        publicDebug {
            minifyEnabled false
            initWith debug
            //shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'


        }



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

        }
    }

    sourceSets {
        main {
            res.srcDirs =
                    [
                            'src/main/res/layouts/stripchart/layout',
                            'src/main/res/layouts/stripchart',
                            'src/main/res/layouts/erfi/layout',
                            'src/main/res/layouts/erfi',
                            'src/main/res/layouts',
                            'src/main/res'
                    ]
        }
    }

    android {
        useLibrary 'org.apache.http.legacy'
    }

}


dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.multidex:multidex:2.0.1'
    // Glide image library
    implementation 'com.github.bumptech.glide:glide:4.11.0'
    //material design
    implementation 'com.google.android.material:material:1.0.0'
    //Circular Image view
    implementation 'com.mikhaellopez:circularimageview:3.0.2'
    //Expandable layout
    implementation 'com.github.florent37:expansionpanel:1.1.1'
    //Vector drawables\
    implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
    //Animated jsons
    implementation 'com.airbnb.android:lottie:3.4.0'
    // Dexter runtime permissions
    implementation 'com.karumi:dexter:6.0.2'
    implementation 'com.squareup.retrofit2:retrofit:2.6.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.12.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
    implementation 'com.google.code.gson:gson:2.8.6'
    //DotsIndicator
    implementation 'com.tbuonomo.andrui:viewpagerdotsindicator:2.0.3'
    //DateTimePciker BottomSheet
    implementation 'com.github.florent37:singledateandtimepicker:2.0.4'
    implementation 'com.google.android.gms:play-services-location:17.0.0'
    //Location settings
    implementation 'io.nlopez.smartlocation:library:3.3.3'
    implementation 'androidx.legacy:legacy-support-v13:1.0.0'

    implementation 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.4.0'

    //Digital Signature
    implementation 'com.kyanogen.signatureview:signature-view:1.0'

    // Shimmer
    // implementation 'com.facebook.shimmer:shimmer:0.5.0'

}

请任何人帮忙解决这个问题。我漏掉了什么吗?

EN

回答 2

Stack Overflow用户

发布于 2020-06-18 10:10:40

我找到了问题的根源。那是在output.json。这就是罪魁祸首。该文件由于某些活动而损坏。我们必须从签名APK生成的目标文件夹中删除该文件。它解决了这个问题。

票数 12
EN

Stack Overflow用户

发布于 2021-05-08 02:46:17

它通过编辑app/build.gradle为我工作

代码语言:javascript
复制
packagingOptions {
    exclude 'META-INF/androidx.legacy_legacy-support-core-utils.version'
    // or exclude 'META-INF/*'
}

或删除应用程序/构建目录

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62384084

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档