Flutter with VS Code, Unable to locate Android Studio executable - flutter

I re-installed Flutter and Android Studio.
I have already installed Java and SDK libraries and I can run the application from VS Code.
But when I tried to open Android module in Android Studio I am getting:
Unable to locate Android Studio executable

if you are on mac the put this in :
flutter config --android-studio-dir "/Applications/Android Studio.app/Contents"

The Flutter extension locates Android Studio by calling flutter config --machine. It looks like Flutter isn't returning an Android Studio path there, so you could run:
flutter config android-studio-dir /path/to/android/studio
And then Flutter should remember it, and provide it to the VS Code extension when it looks.

Simple go to C:\Program Files\Android\Android Studio\jbr
folder and copy all Folder with files
then paste it on C:\Program Files\Android\Android Studio\jre folder
And Restart your PC.
Hope your Problem is gone.
Thank you

Related

when run the Flutter doctor command why it shows "Unable to find bundled Java version." and how to solve that

Android Studio (version 2022.1) X Unable to find bundled Java version.
Go to C:\Program Files\Android\Android Studio then copy all the content of jbr and paste all that content into the jre folder.
Run flutter doctor again
I tried this one and it worked for me
C:\Program Files\Android\Android Studio
then copy the content of jbr and paste the content into the jre folder
run doctor again and problem solved

Android Electric eel Mac M1: Unable to find bundled java version when running flutter doctor -v

I am having problems with android studio upon updating to electric eel. This was not a problem before update. I have a Mac M1 and flutter version is Flutter 3.3.10 • channel stable
When Running flutter doctor -v I get this for the android studio section:
Android Studio (version 2022.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
How do I resolve this issue?
For Windows Users
Step - 1
Install Java JRE (JAVA RUNTIME ENVIRONMENT)
Link
https://www.java.com/en/download/manual.jsp
After downloading Click on Install and Change Installation folder any folder you like
Step - 2
Copy all of this content and GO TO Android Studio Installation Path
for-example
C:\Program Files\Android\Android Studio\jre
By default Android Studio has a folder called JRE
go inside jre folder and paste everything
If JRE folder in Android Studio has anything inside please delete it before pasting.
Congratulations Windows User
I was struggling with this for like two days and I search it on YouTube and found nothing everything was one year old so I end up Julia Pak Channel while she had Mac but I got the idea to find a solution for windows (basically copy-pasting idea) and find a link in her description and I saw her content and she does an amazing job to help people
So Major Thanks to her.
If anyone ends up on her beautiful YouTube Channel
Give her a like and Subscribe to show some LOVE
YouTube:- https://www.youtube.com/#Juliapak
Thanks.
As you can see Unable to find bundled Java version. is the problem when running flutter doctor -v after updating.
This is the work around I did in terminal:
cd /Applications/Android\ Studio.app/Contents/jbr
ln -s ../jbr jdk
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk
Then I did this in finder:
locate Android Studio
right click on Android Studio and click `show package contents'
create a new folder and call it jre
You'll see a jbr folder, open it and copy its contents
paste those contents into the jre folder you created. File structure looks like this now
Honestly I think this is creating redundancy of some sort, but hey it works!🎉🎉 when I run flutter doctor -v I now get this for android studio.
[✓] Android Studio (version 2022.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build
11.0.15+0-b2043.56-8887301)
I'm sure there are better work arounds but this works for me.🥳🥳🥳
link to video showing how I solved this
For mac users, just go to where is your android studio installed
if you install android studio using the installer use
cd /Applications/Android\ Studio.app/Contents
if using JetBrains toolbox use
cd "/Users/ahmedhnewa/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/Android Studio.app/Contents"
you can go to the settings of the ide and find where it's installed
then just type
open .
so it will be opened in finder
copy the folder jbr and rename it to jre
I think the flutter team should look into this so the flutter command line
can know where the bundled JDK is in the new android studio update.
currently, there is no any recent update to the flutter tool but after it get update the issue should be fixed without copy the jbr folder and rename the copied one to jre
Edit
For Linux it's almost the same, just the path of android studio is different, it's depend on where and how did you installed it, for Windows users
just right click on the android studio in the desktop and open file location and
do the exists same thing on all platforms
This solution worked for me on my Mac
Navigate to Applications on finder Right Click Android Studio. Select "Show package contents". And then right-click "Contents" and select "New Terminal at Folder". Finally copy and paste this line and press enter.
ln -s jbr jre
Thank you so much! After upgrading to Android Studio Electric Eel when I check flutter doctor I came across with "unable to find bundled java version" then I saw that and that helped a lot! Thanks for your effort.
Simple Guide
There is problem with Electric eel
Android Studio App contents after installation is not having jre dir
On Mac What i did:
copy the jbr directory available and name it as jre
jre directory with contents will resolve this

SDK and android studio issue in flutter doctor

How do i resolve these 2 errors in flutter
Unable to locate SDK and
Android studio directory
flutterError
Make sure that you installed Android SDK, also make sure that you setup C:..\android\SDK\tools and C:..\android\plateform-tools in your environment variables

android-studio android-studio-dir location

I am trying to get flutter/android studios to work on linux and i am having an issue getting flutter to recognize my android-studio location.
I am able to run android-stuio, but when i try to tell flutter my install location via the android-studio-dir param i get something that doesn't work.
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.27.0-2.0.pre.78, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[!] Android Studio
✗ android-studio-dir = ~/Downloads/android-studio/bin/
✗ Android Studio not found at ~/Downloads/android-studio/bin/
[✓] VS Code (version 1.53.1)
[!] Connected device
! No devices available
At location ~/Downloads/android-studio/bin/ i have the bin directory of my android studio install. This obviously doesn't work.
I have tried to look up what directory android-studio-dir needs to point at and it seems that i wants to point at a directory like /path/to/android/studio.
but in my install directory i dont have a studio directory to point at?
So my question is what should android-studio-dir point at?
I am able to run android studio by ./~/Downloads/android-studio/bin/studio.sh
So i am fairly confident i have android studio "installed" correctly.
For windows the commands are same like those from #Doc but take care of the slashes:
flutter config --android-sdk="C:/TestFolder/AndroidSDK"
flutter config --android-studio-dir="C:/Program Files/Android/Android Studio"
the commands are
flutter config --android-sdk="/home/user/Android/Sdk"
flutter config --android-studio-dir="/usr/local/android-studio"
Don't use the bin folder, just mark the root folder for both the sdk and the IDE. Also, use complete path.
A. To resolve your unrecognized sdk. issue, use following steps
Find your dir. location. You will find at same place
C:\users\UserName\AppData\Local\Android\SDK
Mine was at
C:\Users\SHARM\AppData\Local\Android\Sdk
Go to PowerShell and type
flutter config --android-sdk
"C:\users\UserName\AppData\Local\Android\SDK"
Change your Username above
PowerShell screenshot showing how I resolved unable to locate SDK issue
B. To resolve dir issue, type
flutter config --android-studio-dir "type directory name"
In my case, it was
flutter config --android-studio-dir "C:/Program Files/Android/Android Studio"
C. I have license issue so I am sharing here if in case you encounter it after fixing SDK and dir issue.
C.1 Open you Android Studio
C.2 On main screen, Click Advanced > SDK Manager
SDK Manager
C.3 Select SDK Tools
Check Android SDK Command-line tools and click ‘apply’.
Check Android SDK Command-line tools and click ‘apply’
C.4 Click Apply.
C.5 Your license issue will be resolved. You can test it by again going to PowerShell and type
flutter doctor
You will pass all tests like I did in photoflutter passed all tests
If you want to check your configurations for SDK, dir etc, just type flutter config and it will show you all configurations.

Android Studio Dart And Flutter Plugin is not installed

Here is the flutter doctor result:
[√] Flutter (Channel stable, 1.22.1, on Microsoft Windows [Version 10.0.18362.30], 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.
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
I have already installed the flutter plugin. But the problem still exists. How can I fix this?
Just run this on your terminal (Mac users)
ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1
Well hello all
I would suggest you all to follow the steps what flutter documentation sites tells you to do
For windows-->There are some people who got detected flutter and dart plugins by the flutter doctor and few are not
I got this issue when I tried to install ...
I did everything like installed flutter and dart plugin still my flutter doctor haven't detected the plugins ...
following steps worked for me
flutter channel dev
flutter upgrade
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
flutter doctor -v
note :--- flutter config --android-studio-dir="C:\Program Files\Android\Android Studio" should be example flutter config "C:\Program Files\Android\Android Studio"
above steps worked for me i hope it will helps you too :)
change channel master to dev.
then upgrade.
flutter channel dev
flutter channel upgrade
try again
flutter doctor
Note: I think it's Android Studio 4.1 issue...
Since you say you have flutter plugin installed in Android Studio, and if Android Studio correctly shows your installed plugin, there is no reason to believe any third-party tool reporting otherwise.
Also, this will not affect your flutter development and your IDE plugins will work as expected inside the IDE and flutter tool's commands work independent of the IDE in use.
Android Studio 4.1 apparently changed its default plugin install path.
Related github issue: [flutter_tools] IDE plugin validators should be deprecated #61246
Flutter does not directly use the IDE plugins, so doctor failing to detect them does not affect any behavior (it's just annoying).
open terminal:
run> flutter channel dev
run> flutter channel updrade
open terminal:
Mac User:
flutter config --android-studio-dir=/Applications/Android\ Studio.app
Reinstall Flutter Plugin from Android Studio
Are you using Android Studio V 4.1?
With Android Studio V4.1 there is a problem.
Try to reinstall Android Studio but Version 4.0.1 and try it again, chances are this will fix your problem.
Open Android studio
Follow the Path Configure > Plugins > marketplace > search Flutter & Dart > Install
Restart IDE(Android studio)
Open Terminal and Export Flutter Path
and run flutter doctor -v
If you are upgrading for an existing project:
Run
git clone https://github.com/flutter/flutter.git
in your terminal.
The be sure to delete the Flutter folder in your App's root directory. Otherwise you will get over 50k errors popping up
Check your flutter PATH
which flutter
if you get /path-to-flutter-sdk/bin//flutter or similar you may have added an extra / in your $HOME/.rc_file. Remove the last '/', restart terminal and try again
this worked for me
flutter channel dev
flutter doctor