19

Edit: It seemed to work after restarting everything, no other solution really noticed.

I couldn't find useful solutions on following thread:

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

It's not the same issue, mine doesn't finish installing.

I have an Honor 7 as a connected device and using Visual Studio Code.

When running 'flutter run' following happens:

Launching lib/main.dart on PLK L01 in debug mode...
Initializing gradle...                                       1,1s
Resolving dependencies...                                    3,3s
Gradle task 'assembleDebug'...
Gradle task 'assembleDebug'... Done                         15,6s
Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...                     -

Once last step is loading, my device asks to accept app installation. Once accepted it provides 2 options after installation:

  • Open App

  • Finish ( Meaning = return to home screen )

Either way the last step doesn't finish. 'flutter clean' makes no difference. Hot reload not working. Did anyone else encounter this issue ?


'flutter doctor -v' output:

[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.590], locale de-DE)
    • Flutter version 1.0.0 at F:\flutter
    • Framework revision 5391447fae (3 months ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at C:\Users\user\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-P, build-tools 27.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    • All Android licenses accepted.

[√] Android Studio (version 2.2)
    • Android Studio at E:\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_76-release-b03)

[√] Android Studio (version 3.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[!] IntelliJ IDEA Community Edition (version 2017.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.2
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[!] IntelliJ IDEA Ultimate Edition (version 2017.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.2
    X Flutter plugin not installed; this adds Flutter specific functionality.
    • Dart plugin version 173.4127.31
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[√] VS Code, 32-bit edition (version 1.12.2)
    • VS Code at C:\Program Files (x86)\Microsoft VS Code
    • Flutter extension version 2.22.3

[√] Connected device (1 available)
    • PLK L01 • H8WDU15207300112 • android-arm64 • Android 6.0 (API 23)

! Doctor found issues in 2 categories.
PssstZzz
  • 349
  • 1
  • 3
  • 11

13 Answers13

12

Solutions is quite simple

For flutter hot reload problems that may be happening with your project,

It is a problem with your device, and not flutter or Android Studio

This happens when your logcat hangs up.

You might want to increase your buffer size.

To do this, go into your device or emulator:

Settings > Developer options (Ensure they are turned on),

Change the buffer size to a higher number.

Then run flutter run -v again

Nderitu Kelvin
  • 169
  • 1
  • 2
6

Other user may get solution in this url. In my case the app uninstalled manually so it is not showing in launcher . and got solution in this post.

which is

  1. Go to Settings.
  2. Go to Apps.
  3. Select your app. (here, you can verifythat your app is not uninstalled properly).
  4. Open the overflow menu (which are 3 dots)on the top right and select Uninstall for all users.
R7G
  • 1,000
  • 1
  • 10
  • 15
  • 1
    Thanks, the issue seems to happen when there are multiple users in the device. Manually uninstalling from launcher only removes the app from the current user. – Jayasurya Apr 22 '20 at 12:23
3

In my case the problem was that I forgot to change MainActivity.kt package name after I modified it.

package com.WrongCompanyName.WrongProjectName

import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity: FlutterActivity() {
    override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine);
    }
}
Jofre
  • 531
  • 7
  • 10
2

Make sure your MainActivity.java is in the right location, it has a MainActivity class declaration, and that the package matches your package id.

Reznik
  • 2,663
  • 1
  • 11
  • 31
Warren H
  • 21
  • 1
1

Edit: You can enter this in the terminal

flutter run

And then r to hot reload. You might have to Ctrl+C and n first

It's slower than F5, but still works!

enter image description here

My original answer: I got around this problem by typing the command in the Terminal

flutter run -d <deviceId>

for my LG phone, it was

flutter run -d LGUS998d7315d51
1

My solution was to check the package name (iOS is applicationId) of my Android App. I had recently changed the name of my package from the default "com.example.app_name" to something more custom. However, I had forgotten to change all of the locations.

I believe the most important locations are as follows: Mac / iOS

  • build.gradle -- search for "applicationId"

Android

  • [app_name]\android\app\src\debug\AndroidManifest.xml
  • [app_name]\android\app\src\main\AndroidManifest.xml
  • [app_name]\android\app\src\profile\AndroidManifest.xml

Just search for package="

MaylorTaylor
  • 4,671
  • 16
  • 47
  • 76
1

Open android\app\build.gradle and set a different application id to the app.

defaultConfig {
  // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  applicationId "com.othervalue.sbmicalc"
}

Then remove previous build:

flutter clean

and run again:

flutter run
Matheus Abreu
  • 3,357
  • 1
  • 18
  • 21
0

I have been struggling with this off and on for a year, here is what I just noticed that makes it work or not work on my system.

I discovered tonight that if I have my virus protection running my emulator stalls in the
" --->
Built build\app\outputs\apk\debug\app-debug.apk. and I just get a white screen. I turn off the virus protection and it works fine in debug mode. If its on I have to keep going to the terminal and doing: " flutter run " to see any changes I have made. Maybe this will help someone.

Brian
  • 11
  • 1
0

I faced this problem and found a solution.(I use emulator)

It seems this is just an emulator problem.

AVD Manager -> Actions -> Wipe Data

Maybe you need to do flutter clean, but the problem will solve.

Ballsigno
  • 481
  • 1
  • 4
  • 11
0

In my case, it was not uninstalled the flutter app properly from mobile phone because my mobile has normal space and private space...so when I uninstall the app from normal space it was uninstalled but not uninstall from private space. then after removing the app from private space and run

flutter clean

and run the again it's work fine!

flutter run
lahiru dilshan
  • 690
  • 9
  • 13
0

I have also faced the same issue when I have changed targetSdkVersion to static values (33) in my case

android/app/build.gradle

targetSdkVersion flutter.targetSdkVersion to targetSdkVersion 33

So, By un-doing changes and by adding constant in local.properties worked for me

android/app/build.gradle

targetSdkVersion flutter.targetSdkVersion

and

android/local.properties

flutter.versionName=1.0.0
flutter.versionCode=1
flutter.targetSdkVersion=33
Ketan Ramani
  • 4,874
  • 37
  • 42
0

If you see your app installed like this -> just click it to open. It worked for me

enter image description here

0

It happens with me also whenever I delete an app from the phone.
The simple solution is:

  1. Get the build apk file.
  2. Run:
flutter build apk --release
  1. Install that app in the phone and re run the code.
user16217248
  • 3,119
  • 19
  • 19
  • 37
Raj Aryan
  • 1
  • 1