16

I want to run flutter at the first time. I used VS code and run flutter doctor to verify my installation :

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.12.6 16G29, locale en-ID)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.1)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
[✓] Android Studio (version 3.1)
[✓] VS Code (version 1.27.2)
[✓] Connected devices (1 available)

• No issues found!

It seems like no issues with my installation, but if i run flutter run command, i get an error :

Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                       4.0s
Resolving dependencies...                                   86.8s
Running 'gradlew assembleDebug'...                          34.2s
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk...                  0.3s
Error: ADB exited with exit code 1
adb: failed to install /Users/build/app/outputs/apk/app.apk:
Exception occurred while executing:
android.os.ParcelableException: java.io.IOException: Requested internal only, but not enough space
        at android.util.ExceptionUtils.wrap(ExceptionUtils.java:34)
        at com.android.server.pm.PackageInstallerService.createSession(PackageInstallerService.java:406)
        at com.android.server.pm.PackageManagerShellCommand.doCreateSession(PackageManagerShellCommand.java:2415)
        at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:907)
        at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:158)
        at android.os.ShellCommand.exec(ShellCommand.java:103)
        at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21260)
        at android.os.Binder.shellCommand(Binder.java:634)
        at android.os.Binder.onTransact(Binder.java:532)
        at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2796)
        at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.ja
Error launching application on Android SDK built for x86.

Has anyone ever got an error like me?

Ras
  • 991
  • 3
  • 13
  • 24

3 Answers3

13

Another option is to open emulator which you already have configured and increase allocated memory.

In Android Studio go to :
AVD Manager-> Edit this AVD -> Show Advanced Settings scroll down to Memory and Storage and increase either Internal Storage or SD Card.
This way you don't have to remove any applications you already developed from emulator.
Hope it helps

Msmkt
  • 1,261
  • 16
  • 24
  • 1
    Brilliant. It's not clear if the original question was related to a real phone or the emulator. In any case, it was not clear to me that I could scroll the AVD advanced settings screen! But this fixed a persistent problem I was having running Flutter apps on the emulator. You have to reboot the emulator after making these changes. – jlyonsmith Jan 08 '22 at 01:56
11

but not enough space = you do not have space on the phone, uninstall some applications, and that's it

Javier Vasquez
  • 111
  • 1
  • 4
  • It seemed stupid initially because, for android studio, apps can be installed if you are developing for android only, but not working for flutter. So uninstalled few apps and boom. It ran. – Kishan Solanki Sep 26 '19 at 11:25
2

I also came across this error. You can open virtual device manager from Android studio. Afterwards, you can delete the all data by click wiping data option. (The emulator need to close.)

mrtkprc
  • 57
  • 7