两个具有相同程序包名称的不同项目

时间:2018-09-26 04:50:59

标签: android google-play

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

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

现在,我创建了签名的APK,并尝试在Google Play上上传作为现有项目的更新。但Google Play却显示错误消息:

enter image description here

我增加了代码版本,并再次尝试将应用程序上传到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'

我无法理解我所缺少的或者我所做的是对的。

请为我提供建议和经验。

1 个答案:

答案 0 :(得分:0)

错误消息告诉您确切的错误是什么。

  

您需要为APK或Android App Bundle使用其他版本代码,因为您已经有一个版本代码为7

您以前使用版本代码7上传的APK。如果您使用相同的软件包名称,则在上传新APK时,会将更新发送给用户。发生更新时,必须在您的应用中增加版本代码。将您的应用版本代码(例如,增加到8),重新构建APK,然后APK应该可以正常上传。

相关问题