Scenario-Based Troubleshooting
A rigorous, code-accurate diagnostic manual mapping real-world system symptoms to exact causes across the Laravel backend, Flutter client, Google Maps, Firebase, and payment services.
Scenario-Based Troubleshooting
A rigorous, code-accurate diagnostic manual mapping real-world system symptoms to exact causes across the Laravel backend, Flutter client, Google Maps, Firebase, and payment services.
Table of Contents
- Scenario 01 Orders Not Appearing in Admin Panel
- Scenario 02 Orders Not Reaching Restaurant or Deliveryman
- Scenario 03 Push Notifications Not Firing After Fresh App Install
- Scenario 04 Map Blank, Grey Tile, or “For Development Purposes Only” Watermark
- Scenario 05 Customer Location Not Detected Automatically
- Scenario 06 Payment Succeeds but Order Not Confirmed
- Scenario 07 Customer Login or OTP Verification Failing
- Scenario 08 Images & Restaurant Banners Not Loading (Broken Icons)
- Scenario 09 HTTP 500 Internal Server Error on Laravel Portal
- Scenario 10 CORS or API Base URL Mismatch
- Scenario 11 App Works on Emulator but Crashes on Release Build
Scenario 01 Orders Not Appearing in Admin Panel#
Symptom: Customer completes checkout and receives in-app confirmation, but the order does not show up in the Admin Panel Orders grid (
/orders).Likely Causes:
1. Database transaction rollback due to missing order escalation/dispatch records.
2. Customer app hitting a different API database than the Admin Panel.
3. Server queue worker stopped (if orders dispatch asynchronously).
2. Customer app hitting a different API database than the Admin Panel.
3. Server queue worker stopped (if orders dispatch asynchronously).
What to Check:
• Database: Query
• Flutter config: Verify
• Laravel Log: Inspect
SELECT id, order_status, created_at FROM orders ORDER BY id DESC LIMIT 5; in phpMyAdmin/MySQL.• Flutter config: Verify
AppConstants.baseUrl in lib/app/constants/app_constants.dart matches the exact domain of the Admin Panel.• Laravel Log: Inspect
storage/logs/laravel.log for any SQL constraint or foreign key violations on order_items.
Fix:
1. Align
2. Ensure all migrations are applied by running
3. Clear system caches on the server:
AppConstants.baseUrl with the production domain.2. Ensure all migrations are applied by running
php artisan migrate --force.3. Clear system caches on the server:
php artisan optimize:clear.
How to Confirm: Place a test Cash on Delivery (COD) order in the app. Refresh
/orders in the Admin Panel — the new order should appear at the top of the table within 1 second.
Scenario 02 Orders Not Reaching Restaurant or Deliveryman#
Symptom: Orders are visible to the Super Admin, but vendor cannot see them in their Store portal or assigned rider sees no delivery prompt.
Likely Causes:
1. Store ID mismatch or order not assigned to vendor's branch.
2. Order is unassigned (requires manual dispatch from
3. Deliveryman active status is toggled off or outside shift hours.
2. Order is unassigned (requires manual dispatch from
/orders/unassigned).3. Deliveryman active status is toggled off or outside shift hours.
What to Check:
• Admin Panel: Go to
• Deliverymen List: Check
• Store Assignment: In
/orders/unassigned and verify if the order is awaiting driver assignment.• Deliverymen List: Check
/deliverymen to ensure the driver has active_status = 1 and is assigned to the matching delivery zone.• Store Assignment: In
orders table, verify store_id matches the vendor's registered store ID.
Fix:
1. In Admin Panel, assign an active driver via Orders → Unassigned → Assign Rider.
2. Ensure driver shift schedule in
2. Ensure driver shift schedule in
/deliveryman_shifts covers the current operational hour.
How to Confirm: Assign the order to a test rider account. Open the rider portal/API endpoint
/api/rider/activeOrder — the order details should load immediately.
Scenario 03 Push Notifications Not Firing After Fresh App Install#
Symptom: Order status changes, but no lock-screen push notifications or sound alerts are received on Android or iOS devices.
Likely Causes:
1. Missing or mismatched
2. Firebase Service Account JSON credentials not configured in Admin Panel.
3. Device token not saved in backend (user did not grant POST_NOTIFICATIONS permission on Android 13+).
4. APNs auth key (.p8) missing in Firebase Console for iOS.
google-services.json (Android) or GoogleService-Info.plist (iOS).2. Firebase Service Account JSON credentials not configured in Admin Panel.
3. Device token not saved in backend (user did not grant POST_NOTIFICATIONS permission on Android 13+).
4. APNs auth key (.p8) missing in Firebase Console for iOS.
What to Check:
• Firebase Console: Project Settings → Cloud Messaging → verify package name matches
• Admin Panel: Navigate to
• Database: Check
• Device Settings: Settings → Apps → FoodFeast → Notifications → verify notifications are Allowed.
com.foodfeast.customer.• Admin Panel: Navigate to
/firebase-configurations.edit. Verify that valid Firebase Service Account credentials or Server Key are saved.• Database: Check
fcm_tokens table to confirm the user's device token is recorded with user_id.• Device Settings: Settings → Apps → FoodFeast → Notifications → verify notifications are Allowed.
Fix:
1. Replace
2. In Admin Panel
3. In iOS Xcode, enable Push Notifications and Background Modes → Remote notifications under Runner Signing & Capabilities.
android/app/google-services.json with the correct file from your Firebase console.2. In Admin Panel
/firebase-configurations.edit, upload your Firebase private key JSON file.3. In iOS Xcode, enable Push Notifications and Background Modes → Remote notifications under Runner Signing & Capabilities.
How to Confirm: In the Admin Panel, navigate to Notifications → Add Notification (
/notification/create) and send a test broadcast. The device will receive a heads-up banner with sound.
Scenario 04 Map Blank, Grey Tile, or “For Development Purposes Only” Watermark#
Symptom: Google Map in the mobile app or Admin Panel delivery zone editor renders as a grey box or displays the Google watermark.
Likely Causes:
1. Google Maps API key missing or invalid.
2. Google Cloud project has no active billing account attached.
3. Required Maps SDKs not enabled in Google Cloud Console.
4. HTTP Referrer or Android SHA-1 fingerprint restrictions blocking requests.
2. Google Cloud project has no active billing account attached.
3. Required Maps SDKs not enabled in Google Cloud Console.
4. HTTP Referrer or Android SHA-1 fingerprint restrictions blocking requests.
What to Check:
• Google Cloud Console: Billing → confirm billing account is in good standing.
• Enabled APIs: Confirm Maps SDK for Android, Maps SDK for iOS, Places API, Geocoding API, and Maps JavaScript API are all enabled.
• Android: Inspect
• iOS: Inspect
• Backend: Check
• Enabled APIs: Confirm Maps SDK for Android, Maps SDK for iOS, Places API, Geocoding API, and Maps JavaScript API are all enabled.
• Android: Inspect
android/app/src/main/AndroidManifest.xml line 42 (com.google.android.geo.API_KEY).• iOS: Inspect
ios/Runner/AppDelegate.swift line 12 (GMSServices.provideAPIKey).• Backend: Check
GOOGLE_MAPS_API_KEY in .env.
Fix:
1. Link a credit card/billing account to your Google Cloud project (you will still benefit from Google's $200 free monthly credit).
2. If restricting keys by package name, ensure package name matches
2. If restricting keys by package name, ensure package name matches
com.foodfeast.customer and SHA-1 matches your keystore.
How to Confirm: Open the Flutter app and navigate to the address picker. The interactive road map will render smoothly without watermarks.
Scenario 05 Customer Location Not Detected Automatically#
Symptom: App gets stuck on “Locating...” or falls back to latitude 0.0, longitude 0.0 upon initial opening.
Likely Causes:
1. Location permission denied by user.
2. GPS / Location services toggled off in phone settings.
3. iOS
2. GPS / Location services toggled off in phone settings.
3. iOS
Info.plist missing location usage description strings.
What to Check:
• Device Settings: Check if Location / GPS toggle is enabled on device.
• iOS Info.plist: Verify
• Android Manifest: Verify
• iOS Info.plist: Verify
NSLocationWhenInUseUsageDescription exists in ios/Runner/Info.plist.• Android Manifest: Verify
ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION are declared in AndroidManifest.xml.
Fix:
In phone Settings → Apps → FoodFeast → Permissions → Location → Select “Allow only while using the app”.
How to Confirm: Restart app. Tap the GPS target icon in the search bar — the map will animate to your current street address within 2 seconds.
Scenario 06 Payment Succeeds but Order Not Confirmed#
Symptom: Customer is charged via Stripe or PayPal, but the app shows an error or order status remains “pending payment”.
Likely Causes:
1. Webhook endpoint unreachable or returning 500 error.
2.
3. PayPal token reuse or currency mismatch.
2.
APP_URL in backend .env does not match the live HTTPS domain.3. PayPal token reuse or currency mismatch.
What to Check:
• Laravel .env: Confirm
• Stripe Dashboard: Developers → Webhooks → inspect recent delivery attempts to
• Laravel Log: Search
APP_URL=https://yourdomain.com (strictly no trailing slash and valid HTTPS).• Stripe Dashboard: Developers → Webhooks → inspect recent delivery attempts to
https://yourdomain.com/stripe/success/... for HTTP 200 responses.• Laravel Log: Search
storage/logs/laravel.log for “Payment currency mismatch” or “Subscription replay attack”.
Fix:
1. Ensure currency in
2. Verify SSL certificate is valid and not expired, as Stripe and PayPal reject unencrypted HTTP callbacks.
business_settings matches your Stripe/PayPal account settlement currency (e.g. USD).2. Verify SSL certificate is valid and not expired, as Stripe and PayPal reject unencrypted HTTP callbacks.
How to Confirm: Conduct a live $1.00 test checkout via Stripe test card. After card processing, the mobile app should instantly navigate to the Order Confirmed celebration screen.
Scenario 07 Customer Login or OTP Verification Failing#
Symptom: Customer enters phone number or email, but never receives OTP code, or submitted OTP returns “Invalid code”.
Likely Causes:
1. SMTP / SMS gateway credentials incorrect or unconfigured.
2. Server time out of sync with phone time (causing instant OTP expiration).
3. Database table
2. Server time out of sync with phone time (causing instant OTP expiration).
3. Database table
password_otps missing or locked.
What to Check:
• Admin Panel: Go to
• Database: Check
• Server Clock: Run
/business-settings/smtp-configuration and click Send Test Mail to confirm outbound mail transport.• Database: Check
password_otps table to see if OTP records are generating with active timestamps.• Server Clock: Run
date on server to ensure NTP time synchronization.
Fix:
1. In Admin Panel, configure your SMTP host, port (587), username, password, and encryption (TLS).
2. Synchronize server system clock via
2. Synchronize server system clock via
ntpdate -u pool.ntp.org.
How to Confirm: Use the “Forgot Password” flow on the mobile app. The OTP should land in your inbox within 15 seconds.
Scenario 08 Images & Restaurant Banners Not Loading (Broken Icons)#
Symptom: Product photos and store banners appear as grey placeholder boxes in the mobile app and Admin Panel.
Likely Causes:
1. Laravel storage symlink not created.
2. Incorrect web server directory permissions on
3.
2. Incorrect web server directory permissions on
storage/app/public/.3.
AppConstants.baseUrl1 in Flutter app pointing to wrong media directory.
What to Check:
• Symlink: Check if
• Browser Test: Open an image URL directly:
• Flutter Constants: Verify
public/storage exists and points to ../storage/app/public.• Browser Test: Open an image URL directly:
https://yourdomain.com/storage/products/example.jpg. If it returns 404, symlink is broken; if 403, permissions are wrong.• Flutter Constants: Verify
AppConstants.baseUrl1 in lib/app/constants/app_constants.dart ends with /storage/.
Fix:
Execute the following terminal commands on your Laravel server:
php artisan storage:link
chmod -R 775 storage bootstrap/cache
How to Confirm: Refresh the Admin Panel Stores page — merchant logos and menu thumbnails will render cleanly.
Scenario 09 HTTP 500 Internal Server Error on Laravel Portal#
Symptom: Accessing the Admin Panel or API returns a blank screen or “500 | Server Error”.
Likely Causes:
1. Missing
2. Missing database tables or pending migrations.
3. Stale configuration or route cache.
4. Missing PHP extensions (e.g.
APP_KEY in .env.2. Missing database tables or pending migrations.
3. Stale configuration or route cache.
4. Missing PHP extensions (e.g.
pdo_mysql, gd, fileinfo).
What to Check:
• Open
• Run
storage/logs/laravel.log and inspect the last stack trace.• Run
php -m to verify required PHP extensions: pdo_mysql, curl, openssl, mbstring, xml, gd.
Fix:
Run this command sequence from your Laravel project root:
php artisan key:generate
php artisan migrate --force
php artisan optimize:clear
chmod -R 775 storage bootstrap/cache
How to Confirm: Visit
https://yourdomain.com/login — the login page will load instantly with HTTP status 200.
Scenario 10 CORS or API Base URL Mismatch#
Symptom: Flutter app shows network timeout or DioException:
SocketException: Connection refused or HandshakeException.Likely Causes:
1.
2. Using
3. SSL certificate self-signed or invalid.
AppConstants.baseUrl missing trailing forward slash /.2. Using
http://localhost on a physical device instead of real public domain.3. SSL certificate self-signed or invalid.
What to Check:
• Open
Source_Code/Foodfeast_user_app/lib/app/constants/app_constants.dart line 4:
static const baseUrl = "https://yourdomain.com/api/"; // MUST end with /
Fix:
1. Ensure
2. For local testing on Android emulator, use
baseUrl ends with /api/.2. For local testing on Android emulator, use
http://10.0.2.2:8000/api/ (which loops to computer localhost). For physical devices, deploy on a live HTTPS domain.
How to Confirm: Open
https://yourdomain.com/api/business-settings in a phone web browser — it should return valid JSON settings.
Scenario 11 App Works on Emulator but Crashes on Release Build#
Symptom: Debug build runs perfectly on emulator, but release APK or App Bundle crashes immediately upon opening or fails Firebase login.
Likely Causes:
1. Missing Release SHA-1 / SHA-256 fingerprint in Firebase Console (Debug uses debug keystore; Release uses your production keystore).
2. Code shrinking / R8 / ProGuard stripping essential reflection classes.
2. Code shrinking / R8 / ProGuard stripping essential reflection classes.
What to Check:
• Extract release keystore SHA-1 fingerprint:
keytool -list -v -keystore /path/to/your/upload-keystore.jks
• Check Firebase Console → Project Settings → Your Android App → verify both Debug SHA-1 and Release SHA-1 fingerprints are added.
Fix:
1. Add the Release SHA-1 and SHA-256 fingerprints to your Firebase Console.
2. Re-download
3. Re-compile release APK:
2. Re-download
google-services.json and place it in Source_Code/Foodfeast_user_app/android/app/.3. Re-compile release APK:
flutter clean && flutter build apk --release.
How to Confirm: Install release APK onto a physical Android device:
adb install -r build/app/outputs/flutter-apk/app-release.apk. The app launches smoothly without crashing.