Mobile App Build & Release Guide
Generate production-ready Android App Bundles (AAB), testing APKs, and signed iOS IPA packages for publication on the Google Play Console and Apple App Store.
Mobile App Build & Release Guide
Generate production-ready Android App Bundles (AAB), testing APKs, and signed iOS IPA packages for publication on the Google Play Console and Apple App Store.
Table of Contents
Pre-Build Verification Checklist#
Before compiling release artifacts, confirm each of the following mandatory configurations has been completed in Source_Code/Foodfeast_user_app/:
| Configuration Item | Target File | Status Check |
|---|---|---|
| Production API & Storage URLs | lib/app/constants/app_constants.dart |
Ensure baseUrl and baseUrl1 point to your HTTPS production server. |
| Google Services JSON (Android) | android/app/google-services.json |
Placed with your own Firebase project credentials. |
| Google Services Plist (iOS) | ios/Runner/GoogleService-Info.plist |
Imported via Xcode into Runner group. |
| Google Maps API Keys | AndroidManifest.xml & AppDelegate.swift |
Valid Google Maps SDK key with Maps, Places, and Geocoding APIs enabled. |
| Application Package Name | android/app/build.gradle & Xcode Identity |
Unique reverse domain ID (e.g. com.yourbrand.foodfeast). |
| App Version & Build Number | pubspec.yaml |
Defined as version: 1.0.0+1 (increment +1 with every store upload). |
Android Signing Keystore & key.properties#
Google Play requires all release applications to be cryptographically signed with a secure private key.
Generate the Keystore File
In your terminal, navigate to the Flutter project folder and run the Java keytool utility:
keytool -genkey -v -keystore android/app/key.jks \
-keyalg RSA -keysize 2048 -validity 10000 \
-alias foodfeast
You will be prompted to choose a secure password and enter your organization details.
Create key.properties
Create a new file named key.properties inside the android/ directory:
storePassword=YourKeystorePasswordHere
keyPassword=YourKeystorePasswordHere
keyAlias=foodfeast
storeFile=key.jks
Verify android/app/build.gradle Configuration
Verify that your android/app/build.gradle loads the key.properties credentials and signs the release build type:
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 false
shrinkResources false
}
}
}
Back up key.jks and your passwords in multiple safe locations! If you lose your keystore file, Google Play will permanently reject all future app updates for that package ID, requiring you to publish under a completely new package name.
Build Android APK (Testing / Direct Sideload)#
An APK file can be directly installed on physical Android devices, shared with team members for quality assurance, or distributed outside the Google Play Store.
Method A: Terminal Command (Recommended)
cd Source_Code/Foodfeast_user_app
flutter clean
flutter pub get
flutter build apk --release
The generated APK will be output to:
build/app/outputs/flutter-apk/app-release.apk
Method B: Android Studio GUI
Build Menu Selection
With the project open in Android Studio, click Build → Flutter → Build APK.
Compilation Progress & Completion
Android Studio compiles Gradle dependencies and produces the APK file in the output directory.
Build Android App Bundle (.aab for Google Play)#
Google Play requires the Android App Bundle (.aab) format for all new store publications. App Bundles allow Google Play to generate device-optimized APKs tailored to each user's screen density and CPU architecture.
cd Source_Code/Foodfeast_user_app
flutter clean
flutter pub get
flutter build appbundle --release
The compiled production bundle will be located at:
build/app/outputs/bundle/release/app-release.aab
Upload to Google Play Console
Log in to your Google Play Console.
Select your application, go to Release → Production (or Internal Testing), click Create new release, and upload app-release.aab.
Build iOS IPA & Apple Store Submission#
Follow this end-to-end workflow on macOS with Xcode 15+ to compile and archive the FoodFeast iOS app for TestFlight and App Store review:
An Apple Mac running macOS Sonoma/Sequoia, Xcode 15+, CocoaPods, and an enrolled Apple Developer Account ($99/year).
Register App ID on Apple Developer Portal
Visit developer.apple.com/account, navigate to Certificates, Identifiers & Profiles → Identifiers, click (+), select App IDs → App, and register your explicit Bundle ID (e.g. com.yourbrand.foodfeast) with Push Notifications capability enabled.
Create New App in App Store Connect
Go to appstoreconnect.apple.com/apps, click (+) → New App, select iOS, enter your app name, select the Bundle ID created in Step 1, specify your SKU, and click Create.
Configure Xcode Workspace
Open the Xcode workspace from your terminal:
cd Source_Code/Foodfeast_user_app/ios
pod install --repo-update
open Runner.xcworkspace
In Xcode, click on the root Runner project, select the Runner target, and under Signing & Capabilities, select your Apple Developer Team to enable automatic code signing.
Build IPA Archive via Flutter CLI
cd Source_Code/Foodfeast_user_app
flutter clean
flutter pub get
flutter build ipa --release
The compiled archive will be saved in: build/ios/archive/Runner.xcarchive and the output IPA in build/ios/ipa/.
Upload via Apple Transporter App or Xcode Organizer
Open the free Apple Transporter app from the Mac App Store, drag and drop the generated .ipa file into Transporter, and click Deliver.
Within 10–15 minutes, the build will appear under TestFlight in App Store Connect, ready for internal testing or submission to Apple App Review.
Release Build Troubleshooting Tips#
Ensure that flutter_native_splash: ^2.4.1 remains in the runtime dependencies: block in pubspec.yaml (not in dev_dependencies:). The app invokes FlutterNativeSplash.preserve() and FlutterNativeSplash.remove() in main.dart during bootstrap. Moving this package to dev_dependencies will cause production compilation errors.
| Build Issue | Root Cause | Resolution |
|---|---|---|
Execution failed for task ':app:validateSigningRelease' |
key.properties is missing or contains invalid file paths/passwords |
Ensure android/key.properties exists, paths match key.jks location, and passwords match keystore creation. |
CocoaPods could not find compatible versions for pod |
Outdated CocoaPods repo specs on macOS | Run cd ios && pod repo update && pod install --repo-update. |
Version code has already been used |
Attempting to upload an AAB with a previously uploaded build number | Increment the version number in pubspec.yaml (e.g. from 1.0.0+1 to 1.0.0+2) and re-run flutter build appbundle --release. |