【问题标题】:Two different projects with same package name具有相同包名的两个不同项目
【发布时间】:2018-09-26 04:50:59
【问题描述】:

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

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

现在我创建了签名的 apk 并尝试在 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'

我无法理解我错过了什么或我所做的是对还是错。

请用你的建议和经验指导我。

【问题讨论】:

  • @BhuvaneshwaranVellingiri 我在问题中提到我已经尝试过你的建议但得到了同样的错误。
  • 您想展示您的应用级 build.gradle 文件吗

标签: android google-play


【解决方案1】:

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

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

您之前使用版本代码 7 上传的 APK。如果您保持相同的包名称,当您上传新的 APK 时,您会向用户发送更新。当更新发生时,版本代码必须在您的应用程序中增加。增加你的应用版本代码(例如到8),重建你的APK,APK应该可以正常上传了。

【讨论】:

  • 我上次上传的版本是 5。所以我试着把它变成 6,然后是 7,但每次错误都是一样的。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-03-20
  • 1970-01-01
  • 1970-01-01
  • 2014-01-12
  • 2014-11-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多