Manage Android app flavors on Google Play

生来就可爱ヽ(ⅴ<●) 提交于 2020-06-23 07:16:08

问题


I just created 2 flavors for my app: Staging and Production.

Everything seems to work well in both flavors so now I would like to upload my staging release apk (signed) so that testers can test it.

As I have a different applicationId for my staging app:

    stage {
        applicationId defaultConfig.applicationId + ".stage"
        versionName defaultConfig.versionName + "-stage"
        resValue "string", "app_name", "MyApp Staging"
    }

Do I need to create a new App in console play console and deploy this apk to the new version or is there a way to use the same App?

Right now, when I try to upload the staging release app, I get the following error:

Upload failed
Your APK needs to have the package name com.my.app.

回答1:


If the applicationId is different, it would need to be a separate app in play store. This is on the documentation of applicationId

Every Android app has a unique application ID that looks like a Java package name, such as com.example.myapp. This ID uniquely identifies your app on the device and in Google Play Store. If you want to upload a new version of your app, the application ID (and the certificate you sign it with) must be the same as the original APK—if you change the application ID, Google Play Store treats the APK as a completely different app. So once you publish your app, you should never change the application ID.

If you don't want to "pollute" your play store, one other good option is to use Beta by Fabric for free to simplify distribution of your staging builds for your internal testers and stake holders. Using this they can even download any of the older releases and will be informed of new updates as soon as it is released. There is no waiting time unlike Google Play Store where it might take sometimes few hours or more to make the update available to all the users. Recently Fabric has been bought by Google.

P.S: I just a happy user of Fabric Beta and in no way related to them.



来源:https://stackoverflow.com/questions/43707627/manage-android-app-flavors-on-google-play

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!