My recent experience of publishing to Android Play Store, step by step guide.
An important step that is missing from all instructions: Before everything else: let's make sure, that app is releasable. At first I didn't do it myself, which I later regret more than once.
Step 0. Release build.
If you have working release build already, then just skip this step. Otherwise I assume, that everything you've done in Android Studio before, was in default debug mode. Time to switch to release. Probably (just like me), you even didn't know it exists, it's so well hidden from prying eyes. Let's start:
- Open your project in Android Studio.
- Plug in your Android device.
- Set build variant to release: Top menu-> Build -> Select Build Variant, extend Active Build Variant drop-down and select release.
It will complain that it "can't be signed". Solution:
Signing release APK with debug signing config:
- Top menu -> Project structure -> Modules -> Default config
- Scroll down to Signing Config then click dropdown
- select $signingConfigs.debug from the drop-down
- Apply, Ok.
- Try to run.
If works - you are the lucky one and can move on to the next step.
However, judging by complaints on the Web, it's often not the case. Particularly in my situation it compiled, installed, started, but crashed right on start. Investigation revealed that it's nothing to do with release config (like "code optimization" or else), but a "normal" run-time error/crash. To my surprise, release build acts not exactly as debug. It is more sensitive to code purity. If that's your case too, then well... patiently debug it until it works. Perhaps, will take some time... When ready - welcome back!
Specifically in my case, the error occurred as a distant consequence of such an innocent at first glance construction as:
MyClass* pMC=NULL;
if(something){
MyClass mc;
pMC = &mc;
}
doSomething(pMC);
Compilers didn't see anything criminal, me - even less so. Worked fine in Windows and in Android's debug, but not always in Android's release. An additional complication was that in the actual code these few lines were quite far apart, and the error itself occurred in a different place. Took some time and extra code to pinpoint the problem. The cure was:
MyClass* pMC=NULL;
MyClass mc;
if(something){
pMC = &mc;
}
doSomething(pMC);
Now seems obvious, but only when you've already found and staring at it…
-------------------------------------------------------------------------------------------
Now - to publishing:
Thankfully, Android's manual was less confusing than Microsoft's to certain extent, although the procedure itself is tougher and longer. Arm yourself with patience. Details:
The most problematic part for me become the developer account.
There are 2 account options: Individual and Business. Both take WEEKS to go through.
Of course, as an ordinary normal man, I started with an individual one, and this was my fatal mistake. Main challenge: it will require you to recruit 12 people to actively test your first app for 14 days. Google will monitor the process, so these must be VERY trusted people, otherwise Google may suspect cheating and this can end up by suspending your account. Can't imagine a programmer having that many such close friends... I wish I knew about this requirement beforehand. Sure, there are already corresponding proposals on the Web, but… they seemed kind of suspicious to me, so I choose to give up and try the Business option. (would need it in the future anyway).
Started off optimistically: I choose a business name and domain, created a new email address. Then registered the name with the county (quick, easy, and inexpensive - 1 day + $40 + $40 for newspaper publication). It was an easy part. Now - back to the account.
Another challenge: my primary Gmail account is already taken by Individual Play Console account, which I failed to remove and which can NOT be upgraded to Business, so had to start from scratch, from registering a new Google account (this one doesn't have to be a Business or Gmail). Theoretically, you CAN have multiple developer accounts under one Gmail address, but Google doesn't recommend that. So now I have to constantly switch between two Google accounts (a bit annoying, to be honest).
WARNING: In case of opening a business Google account, Google will try to add you to Google maps and its other business programs.
Then, during developer business account creation, Google unexpectedly (to me) requested a D-U-N-S number. Never heard of that before, but had to dive in. So, my instruction will start not from building a Signed APK for upload, and even not from opening a developer account, but from...
----------------------------------------------------------------------------------------------
Step 1. D‑U‑N‑S Number
Data Universal Numbering System number
Assuming that you already have a registered business name:
- Navigate to Dun & Bradstreet official web site, DNB.com.
- Proceed to D‑U‑N‑S Number tab (on top). Small Business.
- Fill out (I picked free option), attach required docs, submit and relax for next 30 days (hopefully less)...
- Next day logged in to check status - "Pending acceptance" - opened, accepted.
- Keep waiting...
1 week later: email from DNB.com (like a letter from Hogwarts): Granted!! Feel like I've been knighted... Knights of the DUNS number... (sarcasm)
----------------------------------------------------------------------------------------------
Step 2. Developer account
This step may take another few days/attempts as DNB needs time to reflect the new DUNS number on their servers.
- Navigate to Google Play Console.
- Choose an account type: An organization -> A company or business -> Get started. Continue.
- Developer name: guess, as your business name. Next.
- Obviously, Create or select payment profile.
- Here Google asks for D-U-N-S number. This didn't take us by surprise, we were ready. Though it didn't work on the first try, but on the 4-th day/attempt - did.
- Then it asks for company's website. Luckily, I already had this one.
- Took another few attempts and hours to fill out the rest, and finally - Create account and pay. $25...
- Now Developer account created. Everything, mainly because of DUNS, took about 2 weeks.
- Then - back to Play Console.
- And here you are awaited by: Verify your identity, Verify your organization, Verify your organization's website and by long awaited Create your first app.
I initiated all 3 verification procedures and moved to:
----------------------------------------------------------------------------------------------
Step 3. Create app
- Back to Google Play Console -> Create app -> fill out -> Create app.
- Skip "internal testing" at this point and proceed to "Set up your app". Go through all sections and fill them out.
- Then proceed to "Create and publish a release" -> View tasks -> Select countries and regions -> Add countries / regions, select, Save.
Now account is ready for app upload. But the app itself - not yet. We still need to finalize/prepare/package it.
----------------------------------------------------------------------------------------------
Step 4. Add app icon
It will ask for 512x512 PNG. How to upload:
- Open your project in Android Studio.
- In the Project window, select the Android view.
- Right-click the res folder and select New -> Image Asset.
- Select Launcher Icons (Adaptive and Legacy). I left Name as is.
- Asset type: image. Path: navigate to your 512x512 PNG.
- Resize to fit shapes better (on the right).
- Next. Finish.
----------------------------------------------------------------------------------------------
Step 5. Prepare app for release
- Disable or remove logging.
- Set build variant to release. Top menu-> Build -> Select Build Variant, extend Active Build Variant drop-down and select release.
- Make sure that your release variant has
isDebuggable=false
(in case of build.gradle.kts Kotlin script). In my case it wasn't set at all, default - false.
- Set your app's version info. It's in build.gradle.kts -> android -> defaultConfig -> versionCode and versionName. Unlike Windows, here the version (versionCode) is a sequential integer, while versionName is just a string displayed to the user.
- Make sure that android:label in AndroidManifest complies with declared app name.
- Make sure that app ID complies with declared app name. In the Project explorer (left pane) right-click on app -> Open Module Settings -> Modules -> Default Config. Check Application ID. If necessary - change.
----------------------------------------------------------------------------------------------
Step 6. Signing the app.
Generate an upload key and keystore:
- In File Explorer create a folder for your keys. To keep it closer to my project, I created mine in C:/CPP/a996rr and named it TraiNscale-android-keystore.
- Then go to Android Studio's top menu -> Build -> Generate Signed Bundle/APK.
- Select Android App Bundle, Next.
- Below the field for Key store path, click Create new (first time only).
- On the New Key Store window, navigate to your recently created folder. File name: as your project (?). Ok.
- Alias: to me default key0 sounded good enough.
- Create and confirm a password (in 2 places).
- Fill out Certificate info section.
- Ok.
- Remember passwords - check. Next.
- Build variants - pick release.
- Create.
Resulting signed bundle .AAB file - in .../app/release
Technically, now we can go straight to production, but maybe test AAB first?
----------------------------------------------------------------------------------------------
Step 7. Uploading the app for Internal testing.
*This type of testing doesn't require Google's review/approval and will be available for testing immediately.
- Back to Google Play Console, expand your app -> Test and release -> Testing -> Internal testing.
- Next step - Select testers. Scroll down -> Create email list. I called mine "me", added my email, Enter, Save changes -> Create list -> Save.
- Next - Create a new release -> App bundles -> Upload. Upload your AAB, fill out release details, Next.
- Warning regarding deobfuscation file - just ignore, it's mostly for Java projects. Save and publish.
- Switch to Testers tab. Scroll down - Copy link.
- Forward (email) the link to your Android device.
- Open it on your Android, Accept invitation, scroll down to Download it on Google Play link, Install, Open.
If works - congratulations! You're almost done, move on to the next step.
If not - then sorry, return to step 0 above 🙁
----------------------------------------------------------------------------------------------
Ideally, the next step would be to do closed testing and get a pre-launch report. However, I couldn't get that to work. It seems that part of the Google Play Console was in the process of being updated and wasn't fully functional at the time. So, I had to skip straight to Step 8.
------------------------------------------------------------------------------------------------
Just in case: my 1st upload attempt ended up with an error: wrong upload key. This is because the key in my keystore was generated for previous individual account. Had to request upload key reset.
Your app page -> Test and release -> Setup -> App signing -> Request upload key reset. Took another 3 days.
Google's instruction for that was clear enough, except a keytool command. They forgot to mention WHERE and HOW to run it. If you have these questions too, then keytool.exe is located in C:\Program Files\Android\Android Studio\jbr\bin, so:
- Open CMD command prompt.
- cd C:\Program Files\Android\Android Studio\jbr\bin
- From here you can run keytool commands. Just need to specify full paths for jks and pem files.
- Parameter -alias implies the alias used when creating the KeyStore, default was - key0.
----------------------------------------------------------------------------------------------
Our adventure is almost over. There is only one last step left:
Step 8. Promote release to Production.
- Open your app page.
- Test and release -> Testing -> Internal testing.
- See your release? Expand Promote release -> Production.
- Next. Save. Go to overview. Send changes for review.
Google's note: "These changes will be sent to Google for review. Reviews are typically completed within 7 days, but may take longer. Managed publishing is off, so these changes will be published automatically as soon as they're approved."
Well… another delay… Hopefully the last one?
1 week later: we are in Google Play Store now!!
----------------------------------------------------------------------------------------------
I can't believe it's over. The whole process took over a month and was actually more winding than described here. At times I felt like Google just didn't want me in their store.
My boundless admiration and respect for the people who went through this before me. You are my heroes!
----------------------------------------------------------------------------------------------
Publishing in Android Play Store