Tuesday, May 18, 2021

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

Steps

  1. Apply android:visible="false" option to the code (e. g. menu items) that was needed for debug purposes only.
  2. Change version code.
    1. To find it faster, in Android Studio choose menu Edit -> Find -> Find in Path -> search "versionCode" keyword. Or press Ctrl+Shift+F.
    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. If there is no pop up, just build the project again.
  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. If Studio asks for the keystore path:
      1. It could be (at least on Linux) in ~/. android/debug. keystore. However, if we list wrong password for it or other wrong parameters, Studio won't successfully complete the release build.
      2. Try to find old key on our backups, say at Google Drive, and use it.
      3. Worst case: Instead, we can merely create a new keystore (there is a button for that). Than we need to specify new location and new keystore file name, and create password for that. The worst here is that for new key we need to sync it with Google Play Console.
    4. Wait until it is done.
    5. 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.
    6. 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. Usually it is in the project_folder/app/release.
    6. Wait until upload finishes. If doing for the first time, usually it highlights some errors in red on the web page. Well, we 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

If Studio does not explicitly tell, what goes wrong, open "Event Log" in the right bottom part of the Android Studio window.
So problems might be as follows:

Unrecognized languages

Problem:

Ready to send for review 

If the app is stuck at this status, go to left pane -> Publishing overview -> submit for review again.

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. 
FYI, at the Google Play Console, keys are located under "App integrity" menu:
So the idea is we use wrong key when building the release supra locally via Android Studio. This might happen when e. g. we started working from another computer and generated locally new key. The option here is to find our old key. I personally store it at Google Drive (though I admit it is not a best idea). Usually this file has "jks" extension. So we can download the old key from backup and then use it to build aab file via Android Studio (see supra "Make (build) signed aab (or apk) file" -> Press in Android Studio menu: Build->Generate Signed Bundle/APK). 
If the old key is not found, we can generate new one. Though it is more complicated because next we need to sync it with Google Play Console.

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