Android Builds
This guide covers building NativeScript apps for Android devices and Google Play.
Package Types
| Type | Flag | Use Case |
|---|---|---|
| AAB | --aab | Google Play (default for release) |
| APK | --apk | Direct distribution, testing |
AAB (Android App Bundle)
Default for release builds. Required for Google Play:
norrix build android release
# or explicitly
norrix build android release --aabBenefits:
- Smaller download size
- Optimized for each device
- Required for new Play Store apps
APK
For direct distribution or testing:
norrix build android release --apkUse cases:
- Beta testing outside Play Store
- Enterprise distribution
- Development testing
Keystore Configuration
For release builds, you need a signing keystore.
Create a Keystore
keytool -genkey -v \
-keystore release.keystore \
-alias my-app-key \
-keyalg RSA \
-keysize 2048 \
-validity 10000Provide via CLI
norrix build android release \
--keystore ./signing/release.keystore \
--keystore-password $KEYSTORE_PASSWORD \
--key-alias my-app-key \
--key-password $KEY_PASSWORDProvide via Config
// norrix.config.ts
import { defineConfig } from '@norrix/cli';
export default defineConfig({
android: {
keystorePath: './signing/release.keystore',
keyAlias: 'my-app-key',
},
});Note: Store passwords in environment variables or Norrix secrets, not in version control.
Environment Variables
Store keystore passwords securely:
# Set as Norrix secrets
norrix env set KEYSTORE_PASSWORD mysecretpassword
norrix env set KEY_PASSWORD mykeypasswordThese are injected at build time.
Build Artifacts
Successful Android builds produce:
| Artifact | Description |
|---|---|
.aab | Android App Bundle for Play Store |
.apk | Android Package (when using --apk) |
mapping.txt | ProGuard mapping for crash reporting |
Artifacts are uploaded to S3 and available in the dashboard.
Debug Builds
For development and debugging:
norrix build android debugDebug builds:
- Use debug signing
- Enable debugging features
- Include debug symbols
- Faster build times
Version and Build Number
Specify Version
norrix build android release --version 1.2.0Sets versionName in the manifest.
Specify Build Number
norrix build android release --build-number 42Sets versionCode in the manifest.
Auto-Increment
If --build-number is omitted, Norrix automatically increments based on previous builds.
Play Store Submission
After building, submit to Play Store:
# Submit to production
norrix submit android production
# Submit to beta track
norrix submit android beta
# Submit to internal testing
norrix submit android internalTroubleshooting
Signing Failed
- Verify keystore path is correct
- Check key alias exists in keystore
- Ensure passwords are correct
- Confirm keystore isn’t corrupted
AAB Not Accepted
- Check minimum SDK version
- Verify app bundle format
- Ensure signing is valid
Version Code Issues
- Version code must be higher than previous release
- Use
--build-numberto set explicitly - Each track can have different version requirements
ProGuard Issues
- Check
proguard-rules.profor custom rules - Add keep rules for reflection-based code
- Review mapping.txt for obfuscation issues