Tuesday, May 18, 2021

How to post new release of mobile app onto the Google Play

Steps

  1. (Optional) Change version (release) label that is shown at the app to the user. That will help us tracking the production version and confirming that current release is successfully shipped to production. I store version name in the values strings xml file. Instead of counting and incrementing the release number (like 1.2, 1.4 etc) I merely put the date of the last release in its name like "Release of 05/25/2021". This simplifies tracking. E. g. in git commits apart from the commit code (which gives no sense because it is a random symbols hash) the key information about the commit to track is its date. Once release name is changed in strings file, it is populated to the "About" menu section result of the app. Also I make a reference to the version name at the main Activity which is the login Activity of the app. So we see right at the start of the app that the proper version is launched
  2. Change version code.
    1. To find it faster, in Android Studio choose menu Edit -> Find -> Find in Path -> search "versionCode" keyword.
    2. Change versionCode in build.gradle file: increment it by +1. E. g. if the previous versionCode was 6, now it should be 7.
    3. (Optional) Change versionName right before the versionCode in the same file to the consequent similar value.
    4. Sync gradle files after changing the version name. Usually Android Studio suggests to sync in pop up menu after making any change in gradle files.
  3. Make (build) signed aab (or apk) file.
    1. Press in Android Studio menu: Build->Generate Signed Bundle/APK
    2. Go through all the windows by pressing "Next" and eventually "Finish" buttons. At the last step, choose "release" option.
    3. Wait until it is done.
    4. Once finished, Android Studio in the bottom right corner will show pop up (like Toast) message. Click on it, link "locate" allowing to locate the new file. Don't mess it up with the wrong location when uploading to Google Play Console. The location could be like "my_project_folder/app/release". There could be 2 files - aab and apk.
    5. The right one is the file that was last modified (see the "Modified" column in the File Explorer window).
  4. Upload the aab (or apk) file to Google Play Console.
    1. Go to Google Play Console.
    2. Click on the right app in the bottom of the screen.
    3. At the left panel, click "Production".
    4. In the top right, click "Create new release" button. Sometimes when we press "Create new release", close the web page and than reopen it again, the web page shows "Edit release" instead of "Create release". So press "Edit release" then.
    5. In the section "App bundles and APKs", upload the file of aab (or apk) created previously.
    6. Wait until upload finishes. If doing for the first time, usually it highlights some errors in red on the web page. Well, need to fix them then.. See also "Common errors" section infra.
    7. In the right bottom part of the page, press "Save" button
    8. After saving, in the same right bottom of the page, press "Review release" button that became blue after saving.
  5. Finalize the release
    1. Should an error pop up at this stage, 
    2. press "Edit release" button in the right bottom of the page.
      See also the list of common errors below.
    3. If there is no errors, press "Start to rollout" button in the same right bottom of the webpage.
    4. Unlike errors, sometimes there warnings highlighted in yellow (not in red). Usually it is due to excessive amount of code not used etc. For now we don't care about warnings and still can proceed.
  6. Wait until Google completes the app review
    1. From the main page of Google Play Console, go to your app in the bottom of the page.
    2. Click the "Production" tab on the left pane.
    3. Click the "Releases" section and see the status of the latest release. Immediately after uploading, the status will be "In review". 


    4. However later Google will change it to "Available on Google Play". For the first time, review can take multiple days. Every next review is proceed faster though. Now we can download it from Google Play and check the production version :)

Common errors

Might be like the following:

Unrecognized languages

Problem:
Your App Bundle targets the following unrecognized languages: us. The list of supported language codes can be found in the IANA registry. Invalid languages caused by third-party libraries can be excluded using the resConfigs Gradle property.
Solution:
Google per se suggests the solution with manually shrinking the language resources. 
At the app-level buld.gradle file, we can specify explicitly which languages to use by including resConfigs property into the defaultConfig section:
There, we need to specify language not listed in the error text. E. g. if the error says "targets the following unrecognized languages: us" then in build.gradle I specify resConfig("ru").

Signing keys

Problem:
Problems with signing keys, when Google Play requires to sign the app with the initial key while I signed it with the different key. See this stackoverflow answer.

Conclusion

Google often updates its interfaces. So if something is not relevant anymore, please curse me in the comments below :)

No comments:

Post a Comment