Android 具有相同包名的两个不同项目

Android 具有相同包名的两个不同项目,android,google-play,Android,Google Play,我开发了一个Android项目,项目名为DemoMessageing,包名为com.abc.xyz,并将FCM添加到该项目中,作为Firebase中创建的项目,包名为com.abc.xyz,用于云消息传递,应用SHA-1并下载google-service.json。把这个.json放到我的应用程序中。我在Google Play上上传了那个项目,也在Google Play上上传了更新 现在,我在Firebase中创建了一个新项目,该项目与DemoMessageingTest的包名com.abc.x

我开发了一个Android项目,项目名为DemoMessageing,包名为com.abc.xyz,并将FCM添加到该项目中,作为Firebase中创建的项目,包名为com.abc.xyz,用于云消息传递,应用SHA-1并下载google-service.json。把这个.json放到我的应用程序中。我在Google Play上上传了那个项目,也在Google Play上上传了更新

现在,我在Firebase中创建了一个新项目,该项目与DemoMessageingTest的包名com.abc.xyz相同,但项目名称不同。从旧项目(DemoMessageing)中删除了SHA-1,并在Firebase的新项目(DemoMessageingTest)中应用了相同的SHA-1。下载新的google-service.json并放入我的应用程序

现在我创建了已签名的apk,并尝试将其上传到google play上,作为对现有项目的更新。但google play给出的错误是:

我增加了代码版本,并再次尝试在google play上上传应用程序。但是有同样的错误

我的build.gradle如下所示:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}


android {
    compileSdkVersion 27
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "com.abc.xyz"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 8
        versionName "8"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true

        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
    dexOptions {
        javaMaxHeapSize "4g" //specify the heap size for the dex process
        preDexLibraries = false //delete the already predexed libraries
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support.constraint:constraint-layout:1.1.0'
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.whereismytransport.transportapisdk:transportapisdk:1.0.1', {
        exclude group: 'org.json', module: 'json'
    }
    compile('com.twitter.sdk.android:twitter:3.1.1@aar') {
        transitive = true
    }
    compile 'com.android.support:appcompat-v7:27.1.1'
    compile 'com.google.firebase:firebase-messaging:10.2.1'
    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.squareup.retrofit2:retrofit:2.0.2'
    compile 'com.squareup.retrofit2:converter-gson:2.0.2'
    compile 'com.squareup.okhttp3:logging-interceptor:3.4.0'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.google.android.gms:play-services-auth:10.2.1'
    compile 'com.android.support:design:27.1.1'
    compile 'com.android.support:cardview-v7:27.1.1'
    compile 'com.android.support:recyclerview-v7:27.1.1'
    compile 'com.google.android.gms:play-services:10.2.1'
    compile 'com.google.android.gms:play-services-maps:10.2.1'
    compile 'com.squareup.picasso:picasso:2.4.0'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:multidex:1.0.1'
    compile('com.crashlytics.sdk.android:crashlytics:2.7.0@aar') {
        transitive = true;
    }
    compile project(':commonwidget')
    compile project(':common')
    compile project(':panowidget')
    compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
    compile project(':emojilib')
    compile files('libs/commons-lang-2.5.jar')
    compile 'com.amazonaws:aws-android-sdk-core:2.2.13'
    compile 'com.amazonaws:aws-android-sdk-s3:2.2.13'
    compile 'com.amazonaws:aws-android-sdk-ddb:2.2.13'
}
apply plugin: 'com.google.gms.google-services'
我无法理解我遗漏了什么,或者我所做的是对的还是错的


请告诉我您的建议和经验。

错误消息会准确地告诉您错误是什么

您需要为APK或Android应用程序包使用不同的版本代码,因为您已经有一个版本代码为7的应用程序包


您以前上载的APK版本代码为7。如果您保持相同的包名,则在上载新APK时,您将向用户发送更新。更新发生时,应用程序中的版本代码必须增加。增加你的应用程序版本代码(如8),重建你的APK,APK应该可以上传。

@BhuvaneshwaranVellingiri我在问题中提到过,我已经尝试了你的建议,但得到了相同的错误。你想显示你的应用程序级别build.gradle文件吗?我上次上传的版本是5。所以我试着把它设为6,然后设为7,但每次的误差都是一样的。