Flutter run: No supported devices connected error on Mac - flutter

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

Related

Receiving an error when trying to run pub

In VSCode and trying to run the following:
dart pub upgrade
I get the following error:
Error: Error when reading 'pub': No such file or directory
However, my flutter file seems fine. Flutter Doctor output below:
[✓] Flutter (Channel stable, 3.3.4, on macOS 12.6 21G115 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.72.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
Any idea how I can resolve this? Thanks!
first clean dart using dart pub cache clean
then run dart pub get
After that run dart pub get upgrade
try creating a .bashrc file in your user's folder.
Then add the following:
PATH=$PATH:/path/to/dart/installation/bin/folder
export PATH
This can happen when you have installed Dart-sdk two times. One time as a windows installer, and the other through chocolatey for instance. Uninstall the one you have in "Add/Remove programs", or at least make sure you only have one, and it should work.

Android SDK cannot be found

When I run flutter doctor, this is what is says:
[✓] Flutter (Channel stable, 3.3.6, on macOS 12.1 21C52 darwin-arm, locale
en-CN)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup
for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.71.1)
[✓] VS Code (version 1.72.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
! Doctor found issues in 1 category.
I have downloaded android 12 from android studio, so I don't know what could be causing this problem. I didn't download it to a custom location, it is just sitting in my applications.
I tried looking for an answer on StackOverflow and online, but their problem is different from mine.
Use this code in the terminal: flutter config --android-sdk
For use the path where is your Android SDK located. In most cases it is "C:\Users\yourSystemUsername\AppData\Local\Android\Sdk"
First, find the location of your android SDK. If you cant, download again to custom location using SDK Manager from Android Studio.
My location looks like C:\src\Android\SDK
Now run the following command-> flutter config --android-sdk "sdk-location"
In my case, flutter config --android-sdk "C:\src\Android\SDK"
Your sdk file should look something like this

when I start to run flutter doctor it say X Android SDK file not found: adb. how I solve this problem

C:\Users\ASUS>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.19042.1526], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
X Android SDK file not found: adb.
[√] Chrome - develop for the web
[√] Android Studio (version 2021.1) ` `
[√] VS Code (version 1.64.2)
[√] Connected device (2 available)
! Doctor found issues in 1 category.
android_sdk/platform-tools/ is not installed in your computer or you made mistake in installing and adding to you path
if your using Android Studio go to settings then System Settings go to Android SDK and install Android SDK Platform-Tools,
if it didnt help reinstall platform-tools, this might be helpful
you can follow link to install it manually SDK Platform Tools
but remember to add the path of android bin folder in your env
for more info you can read this article
Go to SDK Manager from Settings.
Select Android SDK from Left Sidebar.
Select SDK Tools.
Check Android SDK Command-line Tools (latest) and download and
install it.
Run flutter doctor again
Hope solved

Exception: Profile mode is not supported for iPhone 11 Pro when profile flutter app

When I run app in profile mode in Android Studio 4.1.2:
show this error:
Exception: Profile mode is not supported for iPhone 11 Pro.
why would this happen and what should I do to fix it? This is my env:
~/source/dabai/microservice/soa-illidan-hub on  feature/cardrobot ⌚ 22:29:08
$ ~/apps/flutter/bin/flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.6, on Mac OS X 10.15.7 19H114 darwin-x64, locale en-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
[!] Android Studio (version 4.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Community Edition (version 2020.3.2)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Ultimate Edition (version 2019.2.2)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.53.2)
[✓] Connected device (1 available)
! Error: xiaoqiang 的 iPhone is not connected. Xcode will continue when xiaoqiang 的 iPhone is connected. (code -13)
! Doctor found issues in 3 categories.
using command also failed:
~/Documents/GitHub/cruise-open on  feature/channel ⌚ 22:42:08
$ ~/apps/flutter/bin/flutter run --profile
Profile mode is not supported by sdk gphone x86 arm.
If this issue occurs both on Simulator and physical device, it's possible that timeouts in the Observatory port as mentioned on this thread. Try upgrading the Flutter version that you're using and see if it solves the issue. If it persists, run flutter run --profile --verbose to see more details on what's causing the issue.

Flutter run -d all Won't start chrome

flutter run -d all will start the application on android and iOS Simulators but won't start chrome.
Any Ideas?
Here is my flutter doctor output if that matters:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.12.13+hotfix.6, on Mac OS X 10.15.1 19B88, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.5)
[!] Android Studio
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
✗ Android Studio not found at /Applications/Android/Contents
[!] IntelliJ IDEA Community Edition (version 2019.2.3)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.36.1)
[✓] Connected device (4 available)
! Doctor found issues in 2 categories.
I think this is intended behavior, the same way that if you type flutter run -d all when no other device than Chrome and the web server are available, it outputs No devices found. I guess it's because the web support is still experimental. The only way is flutter run -d chrome.