108

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.

7
  • What Flutter version? Nov 20, 2018 at 13:59
  • the latest beta is 0.11.7, make sure you use that. Nov 20, 2018 at 14:40
  • Can you post flutter doctor log here? Also are you installing on emulator or actual device, since I faced the same issue when I was trying to install on actual iphone device connected through wifi.
    – Ganapat
    Nov 20, 2018 at 14:49
  • post flutter doctor -v Nov 20, 2018 at 18:15
  • @GünterZöchbauer Vishnu's solution worked for me, see my comments there for my Flutter version.
    – henrykodev
    Jan 17, 2019 at 11:50

62 Answers 62

111

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.

3
  • 26
    This was issue for me. On the device, open Settings > Apps > Find your app & select it > Click on ... at top right > Delete for all users. Once complete, run again and it should install.
    – Ned
    Jan 27, 2020 at 16:01
  • Delete apps for all users works great. Thanks
    – Kenneth N
    Sep 17 at 15:11
  • hah. it's worked. Thanks
    – Nas Shihab
    Oct 24 at 12:27
51

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.

3
  • 13
    An alternative is to go to settings->apps & notifications->See all apps and delete the app in question. In my case, it said it was installed but not for "this user". I went to the 3 dots and choose uninstall for all users. That fixed it. Aug 22, 2019 at 20:49
  • 3
    Just adding to Aron's comment, I have found occasions where deleting from the settings page has still somehow left a reference to the application that only uninstalling from adb can solve.
    – Megadec
    Feb 3, 2020 at 11:52
  • 4
    Just "adb uninstall com.example.application.name" helped me to solve this issue Thanks. Aug 26, 2021 at 8:29
18

I ran into this issue after changing my package name. Following the instructions on this post helped me: Flutter App is not working after changing package name

2
  • 1
    Thanks! I ran in to it for the same reason as well.
    – math4999
    Sep 7, 2019 at 18:50
  • Thanks, saved me literally hours! Sep 26, 2019 at 17:47
16

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.

1
  • this also worked for me.. tried uninstallling by using setting, even using adb command but none of them works..
    – thekucays
    Aug 10, 2021 at 9:26
14

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.

2
  • This worked for me. I am running Flutter (Channel master, v1.1.10-pre.98, on Microsoft Windows [Version 10.0.17134.523], locale en-AU), my device is a real Android 9 on Nokia 7.1.
    – henrykodev
    Jan 17, 2019 at 11:45
  • yeah working but how to hot reload for debug like as usually we run from main.dart on vscode by click run in the top of code void main() async { . ? Jul 3 at 5:26
13

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.
2
  • worked for me, but i did flutter clean and closed VSC after the above solution.
    – UN..D
    Jun 5, 2020 at 15:39
  • works for me. Booom Oct 29, 2021 at 13:30
13

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"

13

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.

0
7

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
7
  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. Proceed if you see command success
  5. Close and reopen your VS window
  6. Run your flutter project again
4
  • 4
    Lol, it works, but why?
    – Alex Rintt
    Apr 11, 2022 at 21:04
  • 1
    Dude, this worked, but why apk doesn't show on android device event if its there installed, and why do we need to manually uninstall it by cmd, please any one specify reason behind it Aug 18, 2022 at 23:44
  • yeah, why does this work?
    – NiiTii
    Jan 11 at 17:31
  • for mac users you do this: ``` "cd /Users/[user]/Library/Android/sdk/platform-tools" "./adb uninstall com.example.application.name" ```
    – NiiTii
    Jan 23 at 15:38
5

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! ;)

4

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: Android Studio not showing Logcat with Flutter

1
  • The best answer, I found out that the problem is from the Admob SDK. Thank you so much. There is a Logcat tab at the bottom. Oct 18, 2019 at 4:24
3

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

<!-- 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)

1
  • If you also comment the <item> tag, the problem is fixed.. thanks
    – jNewbie
    Sep 6, 2019 at 11:15
3

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.

3

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.

0
2

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 :).

2

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);
  }
}
2

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

2

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

1
  • Nailed it! Thank you!
    – Johan
    Sep 17, 2021 at 23:20
2

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.

2

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
2

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

2

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.

1

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

1

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.

1

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.

1

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.

2
  • Welcome to SO @nitinpoojary. I think your answer can be improved and looks truncated. Mar 23, 2020 at 10:35
  • @Stefan Hegny there was some issue i guess while commenting but fixed thanks you for your notice. Mar 27, 2020 at 7:07
1

try this :

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

enter image description here

1

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.

1

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.