在尝试生成签名的APK时,它显示了以下错误消息。
'META-INF/androidx.legacy_legacy-support-core-utils.version‘条目名与碰撞
在此之前,它已经正常工作了几年。此外,我在另一台PC上签了同样的安卓工作室和相同的分级版本,它在那台电脑上工作正常。我正在经历这个问题,特别是一个个人电脑本身,为什么?我已经附上了下面的build.gradle。
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'
}请任何人帮忙解决这个问题。我漏掉了什么吗?
发布于 2020-06-18 10:10:40
我找到了问题的根源。那是在output.json。这就是罪魁祸首。该文件由于某些活动而损坏。我们必须从签名APK生成的目标文件夹中删除该文件。它解决了这个问题。
发布于 2021-05-08 02:46:17
它通过编辑app/build.gradle为我工作
packagingOptions {
exclude 'META-INF/androidx.legacy_legacy-support-core-utils.version'
// or exclude 'META-INF/*'
}或删除应用程序/构建目录
https://stackoverflow.com/questions/62384084
复制相似问题