Publishing BookNest

Publishing the React Native BookNest

The store build differs from every earlier one in three ways: it uses the upload key, it adds the phones' arm64-v8a code to the emulator's x86_64 (the command line overrides the config plugin's x86_64-only setting), and it produces a bundle for Play as well as an APK. The signing properties arrive as environment variables:

Building BookNest 1.1.0 as a signed bundle and APKJSX
. ~/keys/booknest-rn.env           # export BOOKNEST_UPLOAD_PASSWORD=..., kept out of the project
export ORG_GRADLE_PROJECT_BOOKNEST_UPLOAD_STORE_FILE=$HOME/keys/booknest-rn-upload.jks
export ORG_GRADLE_PROJECT_BOOKNEST_UPLOAD_KEY_ALIAS=upload
export ORG_GRADLE_PROJECT_BOOKNEST_UPLOAD_PASSWORD=$BOOKNEST_UPLOAD_PASSWORD
cd android
nice -n 10 ./gradlew --no-daemon --max-workers=2 bundleRelease assembleRelease \
  -PreactNativeArchitectures=arm64-v8a,x86_64
apksigner verify --print-certs app/build/outputs/apk/release/app-release.apk | head -1
Output
...
BUILD SUCCESSFUL in 37m 11s
822 actionable tasks: 794 executed, 28 up-to-date
Signer #1 certificate DN: CN=BookNest Upload, O=Example Books, C=MY

Compiling every C++ module for a second architecture took 37 minutes on a busy four-core machine; nice and --max-workers=2 kept it from starving other work. The bundle is 65 MB and the universal APK 98 MB, and bundletool 4,040 (Signed App Bundle) splits the bundle as Play does and reports what a phone downloads:

Splitting BookNest's bundle as Play does and installing it on the emulatorJSX
BT="java -jar $HOME/tools/bundletool-all-1.18.3.jar"
$BT build-apks --bundle=android/app/build/outputs/bundle/release/app-release.aab \
  --output=booknest.apks --ks=$HOME/keys/booknest-rn-upload.jks \
  --ks-key-alias=upload --ks-pass=pass:$BOOKNEST_UPLOAD_PASSWORD
$BT get-size total --apks=booknest.apks --dimensions=ABI
$BT install-apks --apks=booknest.apks --device-id=emulator-5554
Output
ABI,MIN,MAX
x86_64,39257254,39495726
arm64-v8a,38299618,38538090
The APKs have been extracted in the directory: /tmp/9785476303527648277

A phone downloads about 38 MB. The release embeds its Hermes 11,328 bytecode, so it runs without Metro, and reaches the practice API at the 10.0.2.2:8150 that .env supplied at build time:

BookNest 1.1.0 from the signed release: the splash screen, the catalog, and the new icon in the launcher
BookNest 1.1.0 from the signed release: the splash screen, the catalog, and the new icon in the launcher

app-release.aab is the upload for EAS Submit for Google Play. Keep the keystore and password file out of the repository, with a backup somewhere safe.