【发布时间】:2021-08-27 16:53:59
【问题描述】:
我刚刚复制了我的项目,(我希望有 2 个不同的单独应用程序)。我为第二个更改了包名称和 applicationId,它在模拟器上完美运行,但是当我尝试生成已签名的 apk 时出现此错误:
Entry name 'META-INF/android.support.design_material.version' collided
虽然我可以完美地为我的第一个应用程序做到这一点。
我多次尝试重建和清理项目,但没有任何效果。
这是我的 app/build.gradle:
apply plugin: 'com.android.application'
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileSdkVersion 30
defaultConfig {
applicationId "com.example.apptest"
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.android.volley:volley:1.1.1'
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation "androidx.cardview:cardview:1.0.0"
// https://mvnrepository.com/artifact/com.google.guava/guava
implementation group: 'com.google.guava', name: 'guava', version: '30.1-jre'
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
android.defaultConfig.vectorDrawables.useSupportLibrary = true
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation "androidx.recyclerview:recyclerview:1.2.0"
implementation 'com.github.danylovolokh:LondonEyeLayoutManager:1fb6469521'
implementation 'com.github.leochuan:ViewPagerLayoutManager:v2.0.22'
implementation 'com.squareup.okhttp3:okhttp:4.2.0'
implementation 'com.github.rtoshiro:FullscreenVideoView:1.1.2'
implementation 'androidx.multidex:multidex:2.0.1'
}
如果还有什么我需要放在这里的,请告诉我。 请帮助我,告诉我我做错了什么以及我应该怎么做。 谢谢。
PS:两个应用都有不同的键。 PS:我也尝试删除现有的 APK。没用。
【问题讨论】:
标签: java android android-studio build apk