Building 2 Mobile Apps: From 0 to Launch in 6 Days [Day 6 — LAUNCH DAY]

Kathy Li
5 min readOct 24, 2018

Preparing for Soft Launch

First up, app #1, Jet Tag.

Generating a Production Build

I ran this in the project directory on Terminal:

ionic cordova build android --prod --release

Unfortunately I got an error.

⚠️ Today’s Issue

What has been working in the emulator version failed the production build.

> ionic-app-scripts build --prod --target cordova --platform android[18:08:36]  ionic-app-scripts 3.2.0[18:08:36]  build prod started ...[18:08:36]  clean started ...[18:08:36]  clean finished in 31 ms[18:08:36]  copy started ...[18:08:36]  deeplinks started ...[18:08:36]  deeplinks finished in 18 ms[18:08:36]  ngc started ...[18:08:45]  typescript errorType ArrivalPage in /Users/kathy/Development/Ionic/JetTag/src/pages/arrival/arrival.ts is part of thedeclarations of 2 modules: AppModule in /Users/kathy/Development/Ionic/JetTag/src/app/app.module.ts andArrivalPageModule in /Users/kathy/Development/Ionic/JetTag/src/pages/arrival/arrival.module.ts! Pleaseconsider moving ArrivalPage in /Users/kathy/Development/Ionic/JetTag/src/pages/arrival/arrival.ts to ahigher module that imports AppModule in /Users/kathy/Development/Ionic/JetTag/src/app/app.module.ts andArrivalPageModule in /Users/kathy/Development/Ionic/JetTag/src/pages/arrival/arrival.module.ts. You can alsocreate a new NgModule that exports and includes ArrivalPage in/Users/kathy/Development/Ionic/JetTag/src/pages/arrival/arrival.ts then import that NgModule in AppModule in/Users/kathy/Development/Ionic/JetTag/src/app/app.module.ts and ArrivalPageModule in/Users/kathy/Development/Ionic/JetTag/src/pages/arrival/arrival.module.ts.[18:08:45]  ionic-app-script task: "build"[18:08:45]  Error: The Angular AoT build failed. See the issues aboveError: The Angular AoT build failed. See the issues aboveat /Users/kathy/Development/Ionic/JetTag/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:237:55at step (/Users/kathy/Development/Ionic/JetTag/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:32:23)at Object.next (/Users/kathy/Development/Ionic/JetTag/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:13:53)at fulfilled (/Users/kathy/Development/Ionic/JetTag/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:4:58)at <anonymous>[ERROR] An error occurred while running subprocess ionic-app-scripts.ionic-app-scripts build --prod --target cordova --platform android exited with exit code1.Re-running this command with the --verbose flag may provide more information.

Solution

I changed the way the 2 custom Pages and their Modules are imported.

Compiled again and — phew, success! The build is located here:

/JetTag/platforms/android/build/outputs/apk/release/android-release-unsigned.apk

I made a copy of it in the top project directory for signing.

Then I renamed the copy from /android-release-unsigned.apk to /app-release-unsigned.apk

Getting the APK Signed

This is a requirement by Google Play.

First I generated a private key using the keytool command that comes with the JDK:

keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-alias

I was prompted to create a password for the keystore, and had to answer a few questions regarding developer information.

Then a new keystore file was generated in the current directory:

/my-release-key.jks

Note: Make sure to save this file somewhere safe, if you lose it you won’t be able to submit updates to your app!

To sign the unsigned APK, I ran the jarsigner tool which is also included in the JDK:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.jks app-release-unsigned.apk my-alias

And there I had a signed APK.

Optimizing the Signed APK

I used the zipalign tool, which can be found in

~/Library/Android/sdk/build-tools/{version #}/zipalign

For it to work on Terminal, I first added adb to the command line path:

echo ‘export ANDROID_HOME=/Users/kathy/Library/Android/sdk’ >> ~/.bash_profile

Then I added its build tools to the command line path:

echo ‘export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/build-tools/28.0.3’ >> ~/.bash_profile

After which, I refreshed the command line:

source ~/.bash_profile

I moved the signed APK here temporarily for the tool to function in place. And ran:

zipalign -v 4 app-release-unsigned.apk JetTag.apk

Finally I used apksigner to verify that the apk was signed:

apksigner verify JetTag.apk

The final release binary was ready at this point.

Setting up an Open Test on Google Play

The publishing process didn’t take too long, since I had most of the beta-friendly assets and information ready.

  1. Created new app on Google Play Console

2. Completed “Store listing”

3. Completed “Pricing & distribution”

4. Created a new Open Beta track under “App releases”

5. Uploaded final APK

6. Opened up Beta Testing

7. Went back to fully complete “Content rating”

8. And also “Store listing”

And… It’s up!

Repeating the Same Steps for App #2

Both of the apps are currently “pending publication,” which should only take a couple of hours to complete.

30 minutes later:

Woohoo!

👾 Anecdote

While today’s launch wasn’t without its hurdles, I am thankful that everything went quite smoothly for the most part.

Funny thing though, it’s only as I was finishing up with this blog post that I experienced an internet connection outage.

So, I’m actually using mobile data tethering to complete this post :P

What’s Next?

I have to admit that I am quite pleased to have followed through with the entire challenge. Shipping a day earlier than planned, even.

This has been fun.

I will continue to blog about any post-launch developments of this series.

Meanwhile, I will also go ahead and move on to other projects.

Thank you so much for reading. Until next time!

Chronicle

--

--

Kathy Li

Chronicling how we invent and build products from zero to launch. (https://kathy.li)