android emulator not launching my project - flutter

I am new to Flutter and I am creating a new project. I am running the app with "Run without debuging" and selecting the emulator "pixel XL API 30".
The icons of the emulator (plaz, reload, hot reload...) show up for 5 seconds and then disappear. The Vscode is not launching the app.
In the debug console I get the following error: "Exited (1)"
Unable to locate adb
I run flutter doctor -v:
[✓] Flutter (Channel stable, 1.20.1, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[✓] Android Studio (version 4.0)
[✓] Connected device (1 available)
• No issues found!
Someone know why can I not see my project in the emulator?
Thanks.

Related

Android Studio and VS Code stuck on "Syncing files to device" when trying to debug flutter app on iOS simulator with M1 mac

I am working on a flutter app with my M1 MacBook Pro and can't get the debugger of Android Studio or VS Code to work with an iOS simulator (iPhone 14 Pro with iOS 16.2). When I try to start debugging in Android Studio I get this output in the console:
Launching lib/main.dart on iPhone 14 Pro in debug mode...
Running Xcode build...
Xcode build done. 9,5s
Debug service listening on ws://127.0.0.1:62652/S84BCtJtulI=/ws
Syncing files to device iPhone 14 Pro...
After that nothing happens.
I tried running the simulator via Rosetta, but that did not help.
It is running fine with flutter run and from Xcode itself but I want the debugger in Android Studio (or VS Code).
This is the result for flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 3.7.0-13.0.pre.41, on macOS 13.0.1 22A400 darwin-arm64, locale de-DE)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.74.3)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
! Doctor found issues in 1 category.
Am I doing something wrong? Am I missing something?

i can't debug on physical device

i am trying to debug on a physical device a flutter app. During launch it freezes on:
Running Gradle task 'assembleDebug'...
i run the program with
flutter run -v
, everything works perfectly.
this is my flutter doctor
Doctor summary (to see all details, run flutter doctor -v): [✓]
Flutter (Channel stable, 3.3.7, on macOS 13.0.1 22A400 darwin-arm,
locale it-IT) [✓] Android toolchain - develop for Android devices
(Android SDK version 33.0.0-rc1) [✓] Xcode - develop for iOS and macOS
(Xcode 14.1) [✓] Chrome - develop for the web [✓] Android Studio
(version 2021.3) [✓] VS Code (version 1.73.1) [✓] Connected device (4
available) [✓] HTTP Host Availability
• No issues found!
during startup I get a white screen on the physical device, but I don't get errors of any kind.
help please?
it happened to me many times,
when that happened I use flutter clean and then close and reopen
vs code and most important I delete my old versions of the app this soluation works fine for me and I hope that helps you

avoid use of removable GPUs (via com.apple.CoreSimulator.simctl:GPUSelectionPolicy->avoidRemovable)

Today when I start the flutter app in Mac Book Pro M1(the code did not change and runs fine in the Old 2019 Mac Book Pro), shows error like this:
This will generate a JSON format file containing all messages that
need to be translated.
Launching lib/main.dart on iPhone 13 in debug mode...
Running pod install...
Running Xcode build...
Xcode build done. 35.1s
Exception: Unable to launch com.earth.dolphin on 1DF4FFBC-4606-4406-A67D-8A263A470676:
ProcessException: Process exited abnormally:
com.earth.dolphin: -1
2022-03-06 18:23:50.661 simctl[62639:2998773] apply_selection_policy_once: avoid use of removable GPUs (via com.apple.CoreSimulator.simctl:GPUSelectionPolicy->avoidRemovable)
An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=3):
The request to open "com.earth.dolphin" failed.
The process did launch, but has since exited or crashed.
Command: /usr/bin/arch -arm64e xcrun simctl launch 1DF4FFBC-4606-4406-A67D-8A263A470676 com.earth.dolphin --enable-dart-profiling --enable-checked-mode --verify-entry-points --start-paused --observatory-port=0
Error launching application on iPhone 13.
why did this happen and what should I do to fix it? Seems no one facing the problem after searching from Google. This is the flutter info:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.2, on macOS 12.2.1 21D62 darwin-arm, locale en-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] Android Studio (version 2021.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.1)
[✓] VS Code (version 1.64.2)
[✓] Connected device (3 available)

Failed to launch DevTools: TimeoutException after 0:00:10.000000: Future not completed

The flutter tools aren't launching when I press the button on Android Studio, and I also get a warning when I use flutter run.
I've tried flutter clean, but this still happens on both the terminal and Android Studio flutter plugin.
flutter doctor output:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.2, on macOS 11.2.3 20D91 darwin-x64, locale
en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] Android Studio
[✓] VS Code (version 1.54.3)
[✓] Connected device (2 available)
• No issues found!
Does anyone have suggestions on how to fix this?
Rebooting my computer fixed it.

Flutter run: No supported devices connected error on Mac

I cannot seem to run my flutter project anymore. I created a new empty one and still the same: I get the same error
No supported devices connected.
The following devices were found, but are not supported by this project:
Chrome (web) • chrome • web-javascript • Google Chrome 88.0.4324.192
If you would like your app to run on web, consider running flutter create . to
generate projects for these platforms.
It worked perfectly before! I used fluter doctor to check if everything is ok
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.2 20D80 darwin-arm, locale
en-GB)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
✗ Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
[!] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS
development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.53.2)
[✓] Connected device (1 available)
I run my projects in VSCode and worked perfectly fine before... Flutter is put to date.
When I do flutterdeviced the IOS Simulator does not appear anymore :(
Accept licenses and try again. May be they changed agreement
run: flutter doctor --android-licenses
export PATH="$PATH://Users/USERNAME/dev/flutter/bin"
USERNAME= which user
dev = where flutter is
flutter doctor --android-licenses