How to fix Flutter doctor android studio plugin(Dart , Flutter) issue? - flutter

I installed the latest version of the Android Studio(4.1.1), the latest version of Flutter (Flutter 1.22.4 • channel stable). I installed the Dart & Flutter plugin in Android Studio. But the flutter doctor gives the plug-in is not installed issue.
Here is flutter doctor command result:
[√] Flutter (Channel stable, 1.22.4, on Microsoft Windows [Version 10.0.16299.19], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[!] Android Studio (version 4.1.0)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
I set the android studio config path
flutter config --android-studio dir="C:\Program Files\Android\Android Studio"
But the result is the same.

flutter upgrade
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
flutter doctor -v
then if the issue still persists then just shift to the beta channel and the upgrade flutter then it will fix it.
flutter channel stable
flutter upgrade
Run the above commands in terminal.

(Android toolchain) issue: you need to install android studio, if already installed, you need to restart your system and then RUN the following on command prompt
flutter doctor --android-licenses
and you will need to accept all terms and conditions.
(Android Studio) issue: you need to set the following:
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio\"

Related

Android studio is not installed when using flutter doctor

I am running flutter doctor command. But it is saying android studio is not installed many times. I tried flutter config --android-studio-dir=/home/khamidjon/.android, and many more paths I tried to show but to no luck.
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.1, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Chrome - develop for the web
[!] Android Studio
✗ android-studio-dir = /home/khamidjon/.android
✗ Unable to find bundled Java version.
[✓] IntelliJ IDEA Community Edition (version 2020.3)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
My question is what location should be shown for PATH in flutter config --android-studio-dir='PATH'?
For Android Studio installed with Flatpak, i found this config to work:
flutter config --android-studio-dir=/path/to/home/.local/share/flatpak/app/com.google.AndroidStudio/current/active/files/extra/android-studio
Where path/to/home is the path to your home directory.
(Ubuntu 21.10/Pop!_OS)
Snap packages are installed under /snap/appname/ with subdirectories for each new version. Try this to reslove the issue, it worked for me.
flutter config --android-studio-dir="/snap/android-studio/current/android-studio"
The current directory will make sure that it always points to the latest version.
if you have Androind Studio installed in your home directory /home/khamidjon set up PATH like this: /home/khamidjon/android-studio/bin
to append variable in Linux use command
export PATH=$PATH:/some/new/path
to check your PATH use
echo $PATH
In my case snap packages can retain old versions of the program. So inside /snap/android-studio There were 2 versions of android studio inside directories /snap/android-studio/99 and /snap/android-studio/100. So I showed one of these paths: directory /snap/android-studio/100/android-studio with latest version.
So I ran:
flutter config --android-studio-dir=/snap/android-studio/100/android-studio
flutter doctor
Result:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.1, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Chrome - develop for the web
[✓] Android Studio
[✓] IntelliJ IDEA Community Edition (version 2020.3)
[✓] Connected device (2 available)
• No issues found!
In windows
if your Android Studio install by default, you can use this command
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
after this command, flutter can found android studio, but the plugin can't...
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.20.2, on Microsoft Windows [Version 10.0.18363.1016], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[!] Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.48.0)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
In Linux (Ubuntu)
Note: for those who are facing the problem in Ubuntu and Android Studio is installed with snap:
flutter config --android-studio-dir="/snap/android-studio/current/android-studio"
Note: for those who are facing the problem in Ubuntu and Android Studio is installed with JetBrains Toolbox:
flutter config --android-studio-dir=/home/myuser/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7042882
Where ./201.7042822 matches the current version of Android Studio installed. You'll have to check which one you have and update it in the command above.

I am new at android dev and I tried to install flutter but getting this error. What to do next?

enter image description hereC:\Users\KIIT>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.22.6, on Microsoft Windows [Version 10.0.19041.804], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[!] Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
X android-studio-dir = 'C:\Program
X Android Studio not found at 'C:\Program
[√] VS Code (version 1.53.2)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
In android studio settings>plugin search for flutter plugin and dart plugin install both of them.
Step-1: First, you need to install Dart Sdk
Reference: https://dart.dev/get-dart
To install the Dart SDK:
choco install dart-sdk
To upgrade the Dart SDK:
choco upgrade dart-sdk
Step-2: Then install the latest Flutter SDK
Reference: https://docs.flutter.dev/get-started/install/windows
git clone https://github.com/flutter/flutter.git -b stable
Step-3: Now Open Android Studio and check for Plugin updates
**Step-4:**Restart Android Studio and open New Project.
Now you will see Options
Step-5: Run flutter doctor again:
Now you will get output like
Now you are ready to go....

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.

Execution failed for task ':google_maps_flutter:compileDebugJavaWithJavac' in Flutter

Was in the process of integration and this error kept occuring tried multiple answers such as using flutter clean or changing the CompiledSdk to no avail. i am debugging on Pixel 2 XL Api level 27.
Here is the output of flutter run -v : https://pastebin.com/UdaFSFvP
Here is the pubspec.yaml : https://pastebin.com/UdaFSFvP
Here is the output of flutter doctor : https://pastebin.com/4DThja3W
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18362.778], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 3.5)
[!] IntelliJ IDEA Community Edition (version 2019.1)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
So i solved this.
If you encounter this error try the following.
1.flutter clean
2.delete pubspec.lock
3.flutter pub get
4.check dependencies versions as some might be incompatible with your target Sdk (this was my error)

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