Android Deployment¶
Complete guide to deploying ShopSync to the Google Play Store.
Prerequisites¶
- Android Studio installed
- Java JDK 11+ configured
- Google Play Developer account
- App signing key created
Setup¶
1. Configure Signing¶
Create android/key.properties:
storePassword=your_store_password
keyPassword=your_key_password
keyAlias=upload
storeFile=../upload-keystore.jks
Security
Add key.properties to .gitignore. Never commit credentials!
2. Update build.gradle¶
In android/app/build.gradle:
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
...
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources true
}
}
}
3. Generate Signing Key¶
keytool -genkey -v -keystore upload-keystore.jks \
-keyalg RSA -keysize 2048 -validity 10000 \
-alias upload
Follow prompts to set passwords and details.
Building for Release¶
APK Build¶
For testing or direct distribution:
Output: build/app/outputs/flutter-apk/app-release.apk
App Bundle (Recommended)¶
For Play Store submission:
Output: build/app/outputs/bundle/release/app-release.aab
Why App Bundle?
- Smaller downloads for users
- Automatic APK optimization
- Required for Play Store
Build Variants¶
Different architectures:
# ARM64 only (most devices)
flutter build apk --release --target-platform android-arm64
# Multiple architectures
flutter build apk --release --split-per-abi
Play Store Submission¶
1. Create App in Play Console¶
- Go to Play Console
- Click Create app
- Fill in app details
- Set up store listing
2. Prepare Store Listing¶
Required:
- App name (30 chars max)
- Short description (80 chars)
- Full description (4000 chars)
- App icon (512x512 PNG)
- Feature graphic (1024x500)
- Screenshots (2-8 images)
Screenshots sizes:
- Phone: 16:9 or 9:16
- Tablet: 16:9 or 9:16 (optional)
- Wear: 1:1 (optional)
3. Upload App Bundle¶
- Go to Release → Production
- Click Create new release
- Upload
app-release.aab - Add release notes
- Review and rollout
4. Content Rating¶
Complete questionnaire for age ratings:
- Navigate to Policy → App content
- Complete rating questionnaire
- Submit for rating
- Apply ratings
5. Privacy Policy¶
Required if app collects data:
- Add privacy policy URL
- Ensure it covers:
- Data collected
- How it's used
- User rights
- Contact information
App Updates¶
Version Management¶
Update in pubspec.yaml:
Format: version+buildNumber
Release Updates¶
- Increment version number
- Update changelog
- Build new app bundle
- Upload to Play Console
- Add release notes
- Review and release
Staged Rollout¶
Gradual rollout to minimize risk:
- Start at 5% of users
- Monitor crash reports
- Increase to 20%, 50%, 100%
- Halt if issues detected
Testing¶
Internal Testing¶
Quick testing with team:
- Create Internal testing track
- Add tester emails
- Upload APK/AAB
- Share test link
Closed Testing¶
Beta testing with select users:
- Create Closed testing track
- Create tester list (up to 2000)
- Upload APK/AAB
- Collect feedback
Open Testing¶
Public beta:
- Create Open testing track
- Set opt-in link
- Upload APK/AAB
- Monitor metrics
Build Optimization¶
ProGuard/R8¶
Shrink and obfuscate code:
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Code Obfuscation¶
In build command:
App Size Reduction¶
android {
...
bundle {
language {
enableSplit = true
}
density {
enableSplit = true
}
abi {
enableSplit = true
}
}
}
Common Issues¶
Signing Errors¶
Issue: Key not found
Solution:
- Verify
key.propertiespath - Check keystore file location
- Ensure passwords are correct
Build Failures¶
Issue: Build failed with Gradle errors
Solution:
Upload Rejected¶
Issue: Play Console rejects upload
Common reasons:
- Version code not incremented
- Signing certificate mismatch
- API level too low
Release Checklist¶
- Version number incremented
- Changelog updated
- Signing configured
- Build successful
- Tested on multiple devices
- Store listing updated
- Screenshots current
- Privacy policy updated
- Content rating complete
- Release notes written
Monitoring¶
Crash Reports¶
View in Play Console:
- Quality → Android vitals
- Review crash clusters
- Download stack traces
- Fix and release update
Performance¶
Monitor key metrics:
- ANR (App Not Responding) rate
- Crash rate
- Battery usage
- Rendering times
Resources¶
See also: CI/CD | Web Deployment