I'm receiving the following error while running flutter run
on some projects, however, on other projects it works fine:
(base) Nusraths-MacBook-Pro:flutter_uber_clone rahama$ flutter emulators --launch Pixel_2_XL_API_28
(base) Nusraths-MacBook-Pro:flutter_uber_clone rahama$ flutter run
Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing Gradle... 0.8s
Resolving dependencies... 1.4s
Running Gradle task 'assembly debug'...
Running Gradle task 'assembly debug'... Done 9.3s
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk... 1.9s
Error: ADB exited with exit code 1
Performing Streamed Install
ADB: failed to install /Users/rahama/development/flutter_uber_clone/build/app/outputs/apk/app.apk: Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
Error launching the application on Android SDK built for x86.
It's just the flutter demo project, I haven't made any changes to it.
Actually, the answer lies in the error message of your question:
[ADB: failed to install /Users/rahama/development/flutter_uber_clone/build/app/outputs/apk/app.apk: Failure
[INSTALL_FAILED_INSUFFICIENT_STORAGE]
Error launching the application on Android SDK built for x86.]
Your Emulator is running out of space, clear its cache:
You are set to go..
Flutter had a new update (I think last night), run flutter upgrade
in the terminal and it should work fine (at least that did it for me).
Docs: To update both the Flutter SDK and the packages that your app depends on, use the flutter upgrade
command from the root of your app (the same directory that contains the pubspec.yaml file)
Although I don't have any other apps installed on my emulator, when I install the flutter app, I get the same error.
I found that the storage space of the emulator is indeed not enough. Because when I created the emulator, the default was only 1024M. When I changed the storage space of the emulator to 4096M, the problem was solved.
this common problem with the Emulator and all you need to clear the Emulator cache . in my case it was the solution...
1- open AVD Manger.
2- click on the (bottom arrow) that beside (Edit) button.
3- choose Wipe Data.
In my case, it was caused by an adb glitch, not a flutter problem.
This was solved by doing a combination of the following, not sure which step fixed it exactly
adb kill-server
, and then adb start-server
None of the existing answers worked for me, so it wasn't a flutter problem. A plain adb install any.apk
didn't work. So I narrowed it down to an adb/usb issue.
Note: Following is answer for stuck at Performing Streamed Install
by adb install xxx.apk
:
use adb install xxx.apk
and showing Performing Streamed Install
but stuck, hang forever.
adb -s hxxxxxxxxs install -r /Users/limao/dev/xxx/crawler/appAutoCrawler/AppCrawler/task/20201202_xxx_0192LeiMoChuanShuo/20201202_xxx_0192LeiMoChuanShuo_gameApp_Android/20201202_xxx_0192LeiMoChuanShuo_gameApp_Android_0.apk
adb -s hxxxxxxxxs install -r /var/folders/gt/5868sbcd1jq4rxvryqhy2_1sz8n0s3/T/tmpq3ypjfgd/20201202_xxx_0192LeiMoChuanShuo_gameApp_Android_0.apk
adb shell pm install
but not supportall not work.
update (original old version 29.0.5
) adb
to latest version ( 30.0.5
)
https://developer.android.com/studio/releases/platform-tools
to download your platform adb
or:
goto
https://www.xda-developers.com/google-releases-separate-adb-and-fastboot-binary-downloads/
to download:
unzip to got folder platform-tools
add the folder to your PATH
variable
eg:
vi ~/.zshrc
PATH=/Users/limao/dev/tools/android/adb/platform-tools:$PATH
就我而言,这是通过更新 android studio 和所有 flutter 和 dart 插件解决的。
Go to File>> invalidate caches
I was having the same issue with a physical device connected via wifi, then I figured out what was wrong. The battery of my device was below 15%, it worked as expected after charging. So, keep an eye on the battery status if you're working with a physical device via wifi.
Sometimes it can work by uninstalling your app and and all it's data then try again,
another fix is to send the apk you are trying to install from projectname/build/app/outputs/apk
and to your device and install it and try again .
Run in terminal
$ flutter clean
and then
$ flutter pub get
and then
$ flutter packages get
then
$ flutter run
By this way I resolved this issues on BlueStack . Do these steps for running android applications on BlueStack Emulator.
Go to setting of BlueStack Emulator
Then click on Advance and then
Turn on Android Debug Bridge (ADB)
This question gets the first result from Google, so my answer covers a bit different error.
The error in question has [INSTALL_FAILED_INSUFFICIENT_STORAGE]
code. My answer is for any Performing Streamed Install
error that does not specifically define [INSTALL_FAILED_INSUFFICIENT_STORAGE]
code.
The problem is this globally installed /usr/bin/adb
overrides the adb
that Flutter uses. As you know, Ubuntu has many outdated packages (to protect their system's stability). ADB is one of them. So, if you try to do:
adb kill-server
adb start-server
You will highly likely get an output similar to below:
* daemon not running; starting now at tcp:5037
ADB server didn't ACK
Full server startup log: /tmp/adb.1000.log
Server had pid: 12668
--- adb starting (pid 12668) ---
adb I 03-26 03:19:35 12668 12668 main.cpp:57] Android Debug Bridge version 1.0.39
adb I 03-26 03:19:35 12668 12668 main.cpp:57] Version 1:8.1.0+r23-5ubuntu2
adb I 03-26 03:19:35 12668 12668 main.cpp:57] Installed as /usr/lib/android-sdk/platform-tools/adb
adb I 03-26 03:19:35 12668 12668 main.cpp:57]
adb I 03-26 03:19:35 12668 12668 adb_auth_host.cpp:416] adb_auth_init...
adb I 03-26 03:19:35 12668 12668 adb_auth_host.cpp:174] read_key_file '/home/erayerdin/.android/adbkey'...
adb I 03-26 03:19:35 12668 12668 adb_auth_host.cpp:391] adb_auth_inotify_init...
adb I 03-26 03:19:35 12668 12668 adb_auth_host.cpp:467] Calling send_auth_response
adb server killed by remote request
* failed to start daemon
error: cannot connect to daemon
In some flutter run
sessions, I've got an output similar to "adb server version (whatever) does not match the client (whatever); killing". That's when I had the doubt maybe I have installed adb
globally. Check this:
which adb
# /usr/bin/adb
# This is a sign that this adb might be globally installed.
# This must be a symlink. Just to make sure, I do the following...
realpath /usr/bin/adb
# /usr/lib/android-sdk/platform-tools
# This is the evidence that it has been installed globally.
So, we use an outdated version of adb
, which does not match the target device's adb server.
So, we need to get rid of this global adb
first.
⚠ Warning
If you use
adb
from terminal, what we are going to do will remove it. You can add your{SDK PATH}/platform-tools
whereSDK PATH
is where you have installed SDK to get it back.
Simply do:
sudo apt remove android-sdk android-sdk-common android-sdk-build-tools android-sdk-build-tools-common android-sdk-platform-tools android-sdk-platform-tools-common
However, doing these actually does not remove adb
from the system. It still lays there for some reason, so, for the last step, we do:
# simply backup our symlink
sudo mv /usr/bin/adb /usr/bin/adb.bak
# and backup global android-sdk tools
sudo mv /usr/lib/android-sdk /usr/lib/android-sdk.bak
After these steps, you can restart your editor and try again. If you want to make double sure, you can optionally do (while your editor's closed):
# clean the build artifacts
flutter clean
# reinstall the packages because we have cleared them
flutter pub get
flutter pub get packages
Android 12 requires you to add a piece of code to your main activity
Go to your project folder and open the AndroidManifest.xml file
Add the below code in the activity
android:exported="true"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.