#!/bin/bash # LuckyChit Android Build Script # Builds both APK and App Bundle for distribution echo "๐Ÿค– Building Android Release" echo "============================" echo "" # Check if we're in the right directory if [ ! -f "pubspec.yaml" ]; then echo "โŒ Error: pubspec.yaml not found!" echo "Please run this script from the luckychit directory" exit 1 fi # Get current version VERSION=$(grep "^version:" pubspec.yaml | sed 's/version: //') echo "๐Ÿ“ฑ App Version: $VERSION" echo "" # Clean echo "๐Ÿงน Step 1/4: Cleaning..." flutter clean # Get dependencies echo "๐Ÿ“ฆ Step 2/4: Getting dependencies..." flutter pub get # Build APK echo "๐Ÿ”จ Step 3/4: Building APK (for direct distribution)..." flutter build apk --release if [ $? -ne 0 ]; then echo "โŒ APK build failed!" exit 1 fi echo "โœ… APK build successful!" echo "" # Build App Bundle echo "๐Ÿ”จ Step 4/4: Building App Bundle (for Play Store)..." flutter build appbundle --release if [ $? -ne 0 ]; then echo "โŒ App Bundle build failed!" exit 1 fi echo "โœ… App Bundle build successful!" echo "" # Show results echo "===========================================" echo "๐ŸŽ‰ Build Complete!" echo "" echo "๐Ÿ“ฆ Output Files:" echo "" echo " APK (Direct Distribution):" echo " ๐Ÿ“„ build/app/outputs/flutter-apk/app-release.apk" APK_SIZE=$(du -h build/app/outputs/flutter-apk/app-release.apk | cut -f1) echo " ๐Ÿ“Š Size: $APK_SIZE" echo "" echo " App Bundle (Google Play Store):" echo " ๐Ÿ“„ build/app/outputs/bundle/release/app-release.aab" AAB_SIZE=$(du -h build/app/outputs/bundle/release/app-release.aab | cut -f1) echo " ๐Ÿ“Š Size: $AAB_SIZE" echo "" echo "๐Ÿ“ค Next Steps:" echo "" echo " For Direct Distribution (APK):" echo " 1. Upload APK to your server or file host" echo " 2. Share download link with users" echo " 3. Users enable 'Install from Unknown Sources'" echo " 4. Users download and install" echo "" echo " For Google Play Store (AAB):" echo " 1. Go to https://play.google.com/console" echo " 2. Select your app" echo " 3. Go to Release โ†’ Production" echo " 4. Create new release" echo " 5. Upload app-release.aab" echo " 6. Add release notes" echo " 7. Review and roll out" echo "" echo "๐Ÿ“‹ Version: $VERSION" echo " Update version in pubspec.yaml for next release" echo ""