Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.
like image 807
PssstZzz Avatar asked Feb 15 '19 01:02

PssstZzz


People also ask

How long does it take to build a flutter APK?

Our analysis of Flutter builds shows that 75% of Flutter apps are built successfully in 9 minutes or less.

Why does the first flutter app build take so long?

When you are going to build the Flutter app for the first time, it takes a very long time than usual because Flutter builds a device-specific IPA or APK file. In this process, the Xcode and Gradle are used to build a file, which usually takes a long time.


3 Answers

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

like image 149
Nderitu Kelvin Avatar answered Sep 22 '22 00:09

Nderitu Kelvin


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.
like image 27
R7G Avatar answered Sep 21 '22 00:09

R7G


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);
    }
}
like image 44
Jofre Avatar answered Sep 23 '22 00:09

Jofre