Flutter: flutter run stuck at “Installing build/app/outputs/flutter-apk/app-debug.apk”

Link Copied To Clipboard !

Flutter

If you’re a Flutter developer, you might have encountered a frustrating issue where running your app with flutter run gets stuck at the message “Installing build/app/outputs/flutter-apk/app-debug.apk”. This problem can be caused by various factors, but fear not – there are several solutions you can try to resolve it. In this blog post, we’ll walk you through the steps to fix this issue and get your Flutter app up and running smoothly.

Solution 1: Verify Package Name Changes

If you recently changed the package name of your app, this can cause conflicts during installation. Here’s what you can do:

  1. Check Manifest Files: Ensure that the new package name is correctly reflected in both the AndroidManifest.xml file located in android/app/src/main and the Info.plist file in ios/Runner.
  2. Update Build Gradle Files: Navigate to android/app/build.gradle and ensure that the applicationId matches the new package name.
  3. Update MainActivity File: Navigate to android/app/src/your/package/name/MainActivity.kt and modify your/package/name correctly. Make that change to MainActivity.kt file as well.
  4. Rebuild and Reinstall: After making these changes, try running flutter run again.

Solution 2: Validate google-services.json

The google-services.json file is crucial for Firebase integration. If it’s not configured correctly, it can cause installation hang-ups. Here’s how to address this:

  1. Download Correct google-services.json: Make sure you have the correct google-services.json file for your project, and it’s placed in the android/app directory.
  2. Verify Firebase Configuration: Ensure that your Firebase project is correctly set up and associated with the Android app.
  3. Rebuild and Reinstall: After confirming the correct google-services.json, attempt to run the app again.

Solution 3: Clear Residual App Data

If there’s an existing app on the device with the same package name, it might interfere with the installation process. Here’s how to handle it:

  1. Manually Uninstall App: Go to the device’s settings, find the app with the conflicting package name, and uninstall it.
  2. Restart Device: After uninstalling the app, restart the device to clear any residual data.
  3. Rebuild and Reinstall: Once the device is restarted, try running the app again using flutter run.

Conclusion

Being stuck at “Installing build/app/outputs/flutter-apk/app-debug.apk” can be a frustrating hiccup in your Flutter development process. By addressing package name changes, ensuring the correct google-services.json file, and clearing out any remnants of existing apps, you should be able to overcome this obstacle.

Remember, patience and persistence are key when troubleshooting. If one solution doesn’t work, move on to the next. With these steps, you’ll be back on track in no time, building amazing Flutter applications.

HAPPY CODING !


You May Also Like