更新后 Android Studio 北极狐构建失败

标签 android android-studio gradle android-manifest

Android Studio 更新到最新的北极狐版本,打开项目后提示我更新 Gradle 插件,我照做了。
现在,每次我尝试运行一个应用程序(使用更新的插件)时,构建都会失败并显示下一个输出:Zip file '/home/user/path-to-my-project/app/build/outputs/apk/debug/app-debug.apk' already contains entry 'AndroidManifest.xml', cannot overwrite未更新到最新插件版本的旧应用程序不存在此问题。
我已经尝试过 this solution但这没有帮助。
我的 build.gradle 文件如下所示:

plugins {
    id 'com.android.application'
    id 'kotlin-android'
}

android {
    compileSdk 30

    defaultConfig {
        applicationId "com.user.oauthpractice"
        minSdk 27
        targetSdk 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.6.0'
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    implementation 'com.foursquare:foursquare-android-oauth:1.0.3'
}

最佳答案

在删除 implementation 'com.foursquare:foursquare-android-oauth:1.0.3' 后,我尝试了您的 build.gradle ,这个问题就解决了。不知道下面出了什么问题。您只需将版本升级到 1.1.1 即可解决此问题。

关于更新后 Android Studio 北极狐构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68629723/

相关文章:

java - 应用程序正在等待调试器

java - 如何解决 "Duplicate class com.google.android.gms.common.api.zzb found in modules jetified-play-services-base-11.0.1-runtime.jar"

android - 带有使用 OkHttp3 3.3.1 的外部 AAR 的 Retrofit2 NoSuchMethodError

java - 错误 :Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease

android - 多个数据源的分页库DataSource.Factory

android - 仅在 list 中为手机申报的正确方法

从 jar 运行时,Spring-boot jersey 崩溃,找不到文件异常。从源代码运行它没有任何问题

spring - 使用 maven(不是 gradle)生成带有 spring rest docs 的 asciidoctor doc

android - 如何在 ShinobiCharts 中显示网格线

java - 将外部 .jar 文件导入 Android 项目