Unable to run Flutter Plugin in Android Studio - flutter

I am trying to create a Flutter Plugin following this: https://flutter.io/developing-packages/#step-1-create-the-package
flutter create --template=plugin -i swift hello
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.9.4, on Mac OS X 10.14 18A391, locale en-DK)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.28.2)
[✓] Connected devices (1 available)
Update: I have added the plugins Dart and Flutter to Android Studio(now Flutter doctor is all checkmarks), but still no run button. Note that this is a plugin generated. I am able to create a new Flutter project, but for this I dont know how to run the example apps?
I can run the example code with flutter run but opening the project in Android Studio do not show any run button?

Related

Flutter launcher icons fails because --sound-null-safety missing

I am trying to create icons for my app using flutter_launcher_icons, with options defined in pubspec.yaml. When I run flutter pub run flutter_launcher_icons:main, I get the following error:
Unable to spawn isolate: error: Library 'file:///Users/cameron/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.9.0/bin/main.dart' was compiled with sound null safety (in strong mode) and it requires --sound-null-safety option at runtime
pub finished with exit code 1
Even if I pass in --sound-null-safety, the error persists (I also tried '--no-sound-null-safety' which also did nothing).
To check it wasn't a configuration error, I ran flutter create <name>, added flutter_launcher_icons: to dev dependencies (and flutter pub get), ran the same command and got the same error.
I am on Flutter 2.2, and I depend on integration_test, so I can't downgrade to a pre-null-safety version of flutter_launcher_icons, because those versions have transitive dependencies that conflict with integration_test from sdk.
Flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.2, on macOS 11.4 20F71 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)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.4)
[✓] VS Code (version 1.57.1)
[✓] Connected device (2 available)
• No issues found!

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.

Everything is install but in Android Studio Flutter and Dart Error

I installed everything but when I run flutter doctor then this error occurs.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.5.1, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
[✓] Android Studio (version 3.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Connected devices
! No devices available
! Doctor found issues in 2 categories.
you can ignore those errors if you are going to use vscode as your IDE.
The answer to this error is:
flutter channel dev
flutter upgrade
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
flutter doctor -v
when I run these 4 commands then this error will automatically solve.

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.

flutter on mac desktop "No devices detected"

I have run:
export ENABLE_FLUTTER_DESKTOP=true
flutter channel master
flutter upgrade
Then on flutter doctor i get no devices available:
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.10.15-pre.357, on Mac OS X 10.14.6 18G103, locale en-IL)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
[✓] Android Studio (version 3.4)
[!] IntelliJ IDEA Ultimate Edition (version 2019.1.3)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Community Edition (version 2019.1.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.39.2)
[!] Connected device
! No devices available
! Doctor found issues in 4 categories.
Did I miss anything? (I'm looking to develop a desktop app so not android emulator / ios emulator)
Whatever instructions you are following are out of date; ENABLE_FLUTTER_DESKTOP hasn't been the supported or documented way to enable experimental desktop support for several months (and the legacy code for it was recently removed). You need to enable it with flutter config as documented in the official instructions
Just Enable flutter desktop
flutter config --enable-macos-desktop