Flutter stuck at Installing build\app\outputs\apk\app.apk

FlutterDartApkFlutter ReleaseFlutter Android

Flutter Problem Overview


When I run:

$ flutter run

I'm getting a prompt on my mobile device asking if I want to install the app on my device. I give yes, then nothing happens!

It's stuck here:

Launching lib/main.dart on POCO F1 in debug mode...
Initializing gradle...                                           1.5s
Resolving dependencies...                                        9.2s
Gradle task 'assembleDebug'...                                  22.9s
Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...                     14.9s

Then nothing.

Flutter Solutions


Solution 1 - Flutter

For me, the error was due to my work android profile. I uninstalled the debug app in personal profile but it remained in the work profile, once I uninstalled it there and ran flutter run. It worked without any issues. So, First, ensure you deleted the App in both personal and work profile And then run

flutter run
Update:

By profiles I meant, android user profiles on your phone.

Solution 2 - Flutter

I removed debug application from Android menu, and then I ran into the same issue. I restarted my phone, but it wasn't very helpful. My solution was to remove the application completely and reinstall it by hand:

  1. Connect to the device with ADB

  2. Use adb uninstall com.example.application.name

  3. Use adb install C:\PathToYourProject\build\app\outputs\apk\app.apk

By the way, in such uneasy scenarios, flutter run --verbose could provide more detailed information what went wrong.

Solution 3 - Flutter

I ran into this issue after changing my package name. Following the instructions on this post helped me: https://stackoverflow.com/questions/52283117/flutter-app-is-not-working-after-changing-package-name

Solution 4 - Flutter

Try this

  1. First Install App using flutter run from terminal
  2. When App is Installed. long press on app icon and go to app info.
  3. Force stop app.
  4. Remove cache and delete storage which is contained by app.
  5. Uninstall App.
  6. Install Again. it will work.

Solution 5 - Flutter

If this problem persists in your physical device follow the below operation

Select the app from the apps list in settings (You could see a "not installed for this user" sub along side it)

then Top right menu button "uninstall for all users"

Solution 6 - Flutter

Firstly i removed app with package name on command line. If you do not know package name you can check applicationId in app/build.gradle .

adb uninstall packagename

After then it works.

Solution 7 - Flutter

I solved this by manually installing the apk file generated in the builds folder. After that running flutter run runs the app on my phone.

Solution 8 - Flutter

Running flutter clean solved this issue for me using an emulator.

I wiped the emulator data, deleted my emulator, and created a new one, none of that worked. flutter clean worked though.

Solution 9 - Flutter

I had a problem with this when I uninstalled my app from a device, but unfortunately, I didn't uninstall it from all the users that are on my phone. Even Guest kept a version of my app in it, so I solve this issue with uninstalling all version of my app for all users. After that my app was installed without a problem. Sadly we don't get any error message that something is not right if this happens, so I hope this was a case for you guys and that I help you solve it! ;)

Solution 10 - Flutter

I hit this problem when I commented all my bitmaps in launch_background.xml:

http://schemas.android.com/apk/res/android">

<!-- You can insert your own image assets here -->
<item>
<!--
    <bitmap
        android:gravity="center"
        android:src="@mipmap/launch_320x480" />
    <bitmap
        android:gravity="center"
        android:src="@mipmap/launch_480x320" />
    <bitmap
        android:gravity="center"
        android:src="@mipmap/launch_480x800" />
    <bitmap
        android:gravity="center"
        android:src="@mipmap/launch_800x480" />
    <bitmap
        android:gravity="center"
        android:src="@mipmap/launch_720x1280" />
    <bitmap
        android:gravity="center"
        android:src="@mipmap/launch_1280x720" />
    <bitmap
        android:gravity="center"
        android:src="@mipmap/launch_1280x1920" />            
    <bitmap
        android:gravity="center"
        android:src="@mipmap/launch_1920x1280" />  
-->          
</item>

I uncommented the bitmaps to get the Flutter build to run. I'm on:

Flutter (Channel beta, v1.0.0, on Mac OS X 10.13.6 17G4015, locale en-US)

Solution 11 - Flutter

Installing build\app\outputs\apk\app.apk... is displayed in the Run tab and it doesn't give much information. Please have a look into the Logcat tab and here you can find detailed logs and you may find the reason why you are stuck. If Logcat tab is not visible, please refer this link: https://stackoverflow.com/questions/51007784/android-studio-not-showing-logcat-with-flutter

Solution 12 - Flutter

Background: While the app was being installed by Android Studio, I manually deleted the app from the device. Thereafter I discovered that the app would not install.

This problem was resolved by going to Settings > Apps and noting that the app was disabled rather than uninstalled even though I did confirm the uninstall request. In any case, I tapped the app and performed an uninstall from the Settings > Apps screen.

Solution 13 - Flutter

Very easy solution, just uninstall the app using below command even you did not found app on your device or emulator. This is because sometimes even you uninstall app from device from setting, that app still remains there for other users (Multi user feature in devices). So to completely remove the app from device, use below command and then try to install the app again (Restart the android studio to terminate process if it is already running)

adb uninstall <package.name>

e.g.

adb uninstall com.example.myfirstflutterapp

Solution 14 - Flutter

On your real Android Device GO to SETTINGS> APPS & NOTIFICATION(you can search it!) > APP INFO > chose the app of the current project > PRESS THE 3 dots > Uninstall for all user.

Solution 15 - Flutter

For anybody reading this, I solved this by doing the following:

  1. Open Android Studio->SDK Manager and install API 27 (By default Android Studio only installed the latest (API 28) as at the time of writing and there seem to be issues with using that right now).
  2. In cmd run flutter doctor --android-licenses and make sure you accept all the licenses.
  3. Open Android Studio->AVD Manager and create a new emulator using API 27
  4. Run your app on the new emulator and enjoy!

Hope this helps :).

Solution 16 - Flutter

I also have this problem because I changed a file (my_project\android\app\src\main\java\com\example\my_project\MainActivity.java). and I solved it like this:

package com.example.my_project; //your project name should be changed here.

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;

public class MainActivity extends FlutterActivity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    GeneratedPluginRegistrant.registerWith(this);
  }
}

Solution 17 - Flutter

I fixed it:

1. Power off & Close Android Emulator
2. Reopen Android Studio & go to Tools/ AVD Manager
3. In Virtual Devices List, click Dropdown icon > select 'Wipe Data'. Then click 'Launch this AVD...'
4. Waiting for VD open, then click Run in Android Studio

good luck

Solution 18 - Flutter

Check your AndroidManifest.xml and check that the android:name was properly set with your package name. It worked for me while importing native code.

Solution 19 - Flutter

  1. open cmd in windows

  2. goto this location in cmd C:\Users\[user]\AppData\Local\Android\sdk\platform-tools

  3. type this command :- adb uninstall com.example.application.name(Package name)

  4. if u see command success

  5. then run flutter project again.

Solution 20 - Flutter

When I switched system image for the emulator from Q to Pie it solved it for me.

Solution 21 - Flutter

I got this issue when I uninstalled the flutter app from homescreen. I could not get it installed through android studio or through flutter install commands. What worked for me was to generate the release apk.

flutter build apk

And put the apk in the device and install it again manually through the device. After which there was no issues with installing through both android studio or flutter commands.

Solution 22 - Flutter

I had this problem after I changed the package name. I fixed it by using this guide

In my case I did not have the java files as described in the article but did need to change the kotlin path similarly to the java path described.

Solution 23 - Flutter

In my case problem was with installation of apk. Manual installation of apk works in my case

Solution 24 - Flutter

Check if you have Guest User in your Device ... Go to that user uninstall the application from guest and then switch to your account and then try running it works.

Solution 25 - Flutter

For me, it was a package: admob_flutter

I'd compiled and updated dependencies but used wrong the package. I realize it by looking at the Log in View -> Tool Windows -> Logcat (ALT+6) in Android Studio.

Before the app running in AVD was crashing, but I didn't know why, not seen an error in the Run Terminal, but the Logcat helped me.

Hope it helps someone.

Solution 26 - Flutter

try this :

  • delete "build" package
  • apply "flutter run" command

enter image description here

Solution 27 - Flutter

For me, this error occurs when I add the google firebase in my project, I tried all of the above solutions but not solved the problem, At the end, I could solve this problem by installing the latest version of the Android API virtual device and google play services.

Solution 28 - Flutter

Physical Device : I had the same issue when I uninstalled the app from app drawer.

As already answered, one way to fix this is using ADB to cleanly remove it from your phone, but if you don't have ADB installed, try :

  1. Run flutter clean from the project root folder

  2. Switch to the guest profile on your phone (You must have multiple users enabled, if not enable it in Settings by searching for 'users')

  3. Delete the guest profile. (This can be done by swiping down the notification shade when you are in the guest profile --> clicking on the 'guest icon' next to the settings icon --> delete guest

  4. run main.dart

Should be fixed

Solution 29 - Flutter

According to me this error is caused by some kind of memory leak or something else.So if you are using a physical device, Restarting the physical device and re-installing the app afterwards worked for me.

Solution 30 - Flutter

I use ADB to debug the app and sometimes it gets stuck on installing. I tried reinstalling VS Code and Flutter but found out the issue was with ADB. So, whenever I face this issue I stop the ADB server by:

adb kill-server

and then connect to the device again and the issue is fixed.

Solution 31 - Flutter

If you have changed the app's package name and if you think you did eveything right. Don't forget to change folder name under

\android\app\src\main\kotlin\com\

and also don't fotget to change package name inside MainActivity.kt

Solution 32 - Flutter

It is also happenning caused by flutter plugins that doesn't support android api 28.

In my case it caused by this plugin https://pub.dev/packages/connectivity

Solution 33 - Flutter

This happened for me because there was a typo in gradle.properties. I assume it had something to do with the refactor tool in Android Studio. Two settings ended up on the same line like this:

android.enableJetifier = trueandroid.enableR8=true

When I fixed it, it worked again.

Solution 34 - Flutter

I closed my emulator and android studio and then restarted it.

Solution 35 - Flutter

I solved this issue but I would like mention few things.

  1. My Fresh Installation was stuck at Installing APK...
  2. Same issue on Device as well as in Emulator

I realized that this issue is not device-specific for me. that's why I started looking for solutions.

Solution I tried

  1. Flutter Upgrade ( Using Fresh Copy from Flutter.dev) Didn't Solve my Issue
  2. Android SDK (Using Fresh Android SDK) Didn't Solve my Issue

Luckily, I found an article that explained you need to keep a few directories out from realtime scanning. I was using FREE-Antivirus

I just tried to Uninstall that and Re-started my machine.

Guess What? Issue Solved :)

Solution 36 - Flutter

copy the Apk from build\app\outputs\apk\app.apk to your phone.

find the apk on phone and install it manually.

flutter run on will now work as expected.

Solution 37 - Flutter

I happened with me more than once, and every time I restart my mobile and this problem goes away, I used this solution when I tried all the solutions and fails

Solution 38 - Flutter

I encountered the same problem when I created my first project. My solution would most probably work on a Xiaomi phone only. You should go to the developer options and then check the option "USB debugging(Security Settings)" under the Debugging menu and then your problem should be resolved.

Solution 39 - Flutter

This problem can be solved by increasing the log buffer size in your Mobile Device or AVD. This option will be available in the Developer Options Menu in the Settings of Your AVD or Mobile Device.

Solution 40 - Flutter

Lots of answers here! The one that worked for me -

replace contents of your <app>/android/gradle.properties with the following -

org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true

If you don't want to enable R8

org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
#android.enableR8=true

Solution 41 - Flutter

If you're using MI phone and have turned on second space, i needed to delete the second space (of course i had no data there) to successfully install the apk again. Found this solution here

Solution 42 - Flutter

On the Android physical device:

  1. Unplug the USB cable.
  2. Uninstall the app (from both personal and work profiles) / uninstall for all users (some devices only have this option).
  3. Cleaned up (using an utility app) (optional).
  4. Searched manually by the app name and delete them on the file explorer.
  5. Restart.
  6. Verify developer options are unable correctly. (After enabling as a developer,) check following developer options are enabled:
    • Developer options.
    • USB debugging.
    • Install via USB.
    • USB debugging(Security settings).
    • Select USB configuration: MTP(Media Transfer Protocol).

On the IDE:

  1. Run flutter clean.
  2. Restart the IDE (optional).
  3. Plug the physical device and check the device is connected as debugging device.
  4. Run flutter pub get and make sure no errors (optional).
  5. Run in debug mode.

Solution 43 - Flutter

The simplest solution, COLD BOOT !! (must try before any complex processes)

In my case, I noticed the problem is with my emulator. Even without running any project, the emulator was stuck. Hence same error occurred when I tried to run other projects also. In case you are unable to do Cold boot for your AVD, follow below 2 steps and try again

  1. Stop running your project(main.dart) and
  2. delete the lock file at C:\Users\your_name.android\avd\Nexus_6P_API_30.avd\

Solution 44 - Flutter

Settings>>Accounts and sync>>delete work profile, it will work!!!!

Solution 45 - Flutter

I just faced this too and I found that the problem was I accidentally deleted kotlin/MainActivity. So I created a folder with package name, copied the MainActiviy from another project and put in it. This fixed my problem.

Solution 46 - Flutter

Answer enable Developer options?

  1. Enter Settings -> More settings -> About phone (Version);
  2. Click seven times on Software version;
  3. Developer options will appear in Settings -> More settings.

Solution 47 - Flutter

In my case I disabled play protect on simulator and it worked.

Solution 48 - Flutter

If you are running in the emulator, try Wipe Data in AVD Manager

Solution 49 - Flutter

I tried all the solutions above didn't work

I tried running the app from the main.dart file it worked for me

Solution 50 - Flutter

This worked for me
Step 1: Run flutter clean (this will delete your build directory)
Step 2: Run/Debug the application on Emulator/Physical Device

Solution 51 - Flutter

You can use:

flutter build apk --release 

flutter install

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionVishnuView Question on Stackoverflow
Solution 1 - FlutterStack learnerView Answer on Stackoverflow
Solution 2 - FlutterPsychoXView Answer on Stackoverflow
Solution 3 - FlutterEric DuffettView Answer on Stackoverflow
Solution 4 - FlutterAkram ChauhanView Answer on Stackoverflow
Solution 5 - FlutterJithinView Answer on Stackoverflow
Solution 6 - FlutterGökberk YağcıView Answer on Stackoverflow
Solution 7 - FlutterVishnuView Answer on Stackoverflow
Solution 8 - FlutterBrian OgdenView Answer on Stackoverflow
Solution 9 - FlutterBVanturView Answer on Stackoverflow
Solution 10 - FlutterHahnemannView Answer on Stackoverflow
Solution 11 - Flutteruser3852441View Answer on Stackoverflow
Solution 12 - FlutterTommie C.View Answer on Stackoverflow
Solution 13 - FlutterSmeetView Answer on Stackoverflow
Solution 14 - Flutterbasudev nayakView Answer on Stackoverflow
Solution 15 - FlutterskyzaDevView Answer on Stackoverflow
Solution 16 - FlutterTesla YunView Answer on Stackoverflow
Solution 17 - FlutterNaut BTView Answer on Stackoverflow
Solution 18 - FlutterExpectoPatromView Answer on Stackoverflow
Solution 19 - FlutterAkash SainiView Answer on Stackoverflow
Solution 20 - FlutterTørk EgebergView Answer on Stackoverflow
Solution 21 - FlutterGanadev PrajapathyView Answer on Stackoverflow
Solution 22 - FluttermarkhorrocksView Answer on Stackoverflow
Solution 23 - FlutterArman KhalidView Answer on Stackoverflow
Solution 24 - Flutternitin poojaryView Answer on Stackoverflow
Solution 25 - FlutterDarkonnenView Answer on Stackoverflow
Solution 26 - Flutterfarouk osamaView Answer on Stackoverflow
Solution 27 - Flutterwahid anvaryView Answer on Stackoverflow
Solution 28 - FlutterSumanth V SView Answer on Stackoverflow
Solution 29 - FlutteranmolView Answer on Stackoverflow
Solution 30 - FlutterMubeen RehmanView Answer on Stackoverflow
Solution 31 - FlutterMustafa Ali DikçinarView Answer on Stackoverflow
Solution 32 - FlutterNaranmandakh TsogooView Answer on Stackoverflow
Solution 33 - FlutterMikeView Answer on Stackoverflow
Solution 34 - FlutterAseemView Answer on Stackoverflow
Solution 35 - FlutterAkram ChauhanView Answer on Stackoverflow
Solution 36 - FlutterVivasvan PatelView Answer on Stackoverflow
Solution 37 - Flutterfarouk osamaView Answer on Stackoverflow
Solution 38 - FlutterBHOOPEN SAWANTView Answer on Stackoverflow
Solution 39 - FlutterMadhavanView Answer on Stackoverflow
Solution 40 - FluttersaurabhView Answer on Stackoverflow
Solution 41 - Flutteraashish manandharView Answer on Stackoverflow
Solution 42 - FlutterPasindu JayanathView Answer on Stackoverflow
Solution 43 - FlutterSandeep PeddiView Answer on Stackoverflow
Solution 44 - FlutterPravin KumarView Answer on Stackoverflow
Solution 45 - FlutterVictor ChengView Answer on Stackoverflow
Solution 46 - Flutteruser17257325View Answer on Stackoverflow
Solution 47 - Fluttertakunda madechanguView Answer on Stackoverflow
Solution 48 - FlutterEKALEBView Answer on Stackoverflow
Solution 49 - FlutterAlex JosephView Answer on Stackoverflow
Solution 50 - FlutterRahul BadgujarView Answer on Stackoverflow
Solution 51 - FlutterSapna ChandelView Answer on Stackoverflow