Where is the Flutter SDK? [Ubuntu] - android-studio

I am running Ubuntu - was already using Flutter on Windows.
When I go start a new flutter projet - Android studio can't find the Flutter SDK so I point it towards flutter/bin BUT it still tells me that it can't find the SDK.
1)
So I update my PATH, and it's working great. I can type 'flutter Terminal' on any Terminal location and I get my 4 checkmarks.
BUT NOPE! Android Studio insists that the SDK is not there.
2)
OK FINE! I decide to use the option inside Android studio to install the SDK from the Flutter repo. It installs the WHOLE folder again and ANDROID studio still says that the SDK is not there.
Am I stupid? what am I doing wrong?
I hate Android studio so much - I feel like I spend most of my time troubleshooting AS to work with Flutter instead of coding.
I do love Flutter A LOT! But I feel like the IDE hates Flutter.

set your path as follows.not sure why but it works.flutter v 1.8.7 and abve
export PATH=$PATH:/flutter
no bin folder

Related

Flutter is not being recognized on the machine

I formatted my computer and installed windows 10 again because I wanted to play and Linux was having problems.
I am trying to install flutter and dart for application development, but he is accusing this error.
Flutter doctor
I tested it before changing the flutter to beta and it recognized the flutter and dart plugins, however I want to leave it in the stable channel.
However, my code doesn't recognize it, I believe it is because of these errors with the flutter and dart plugins.
Code
I already installed the plugins through android studio and also vscode.
I tried to uninstall and install again, restart the computer, set path ...
I managed to solve it, I will leave here the solution for those who had the same problem as me.
I changed the channel to the Master and ran a flutter upgrade.
Now everything is running smoothly.
Maybe some bug with the stable channel, I can't say.
So:
Flutter channel master
Flutter upgrade
VOILÁ
Flutter doctor
Did you install flutter plugin in android studio properly? (Recheck in android studio.)
if yes then remove it and reinstall it.
if (1) not working then update your android studio.
keep your flutter sdk in c drive
if still flutter cannot trace plugin then set flutter sdk and dart sdk manually in android studio.
for dart
for flutter

Android Studio not showing Chrome as Flutter device

I got a small problem which accured after reinstalling Android Studio:
Android Studio
Android Studio is not showing Chrome as Device for my Flutter Web project, while flutter doctor shows clearly everything is enabled correctly:
Flutter doctor
I can normally run the flutter project on google chrome using the console or VS Code, but Android Studio does not work. I already checked the Flutter and Dart plugin.
I would be glad if someone who maybe had the same issue or knows how to fix this gets back to me!
Best Regards
Clearly it is not the issue with flutter. It is an issue with your Android Studio installation. You can verify the same by navigating to the your project folder in the terminal (or command prompt) and type
flutter run -d Chrome.
NOTE: The above command works only if you are on master, beta or dev branch and you have already enabled your flutter web support by typing
flutter config --enable-web
I noticed that your path to Android Studio as: C:\Program Files\Android\ Android Studio1
It means that during installation the original Android Studio folder is not deleted. A duplicate folder has been created in the same location. Hence the Android sdk location is must be changed as well.
You can solve this by:
Uninstall Android Studio. Delete the folder at the above location. Reinstall Android Studio. Update sdk path in your sdk manager as well as in your environment variable. (recommended).
Update the sdk folder in the sdk manager as well as your environment variables.

Problems with setting up Android Studio with Flutter on Mac

I made my project on Windows computer, now I'm trying to export to ios on friend's Mac. I've been following this tutorial from part 1 all the way to part 5. How to Install and Setup Flutter for App Development on Mac - Part 1. In other words, Xcode is installed, Android Studio with Flutter and dart plugin installed as well. Android Studio recognizes both simulator and plugged iPhone. When I open the project in Android Studio it looks like this:
Note: Both flutter folder and the project folder are located in "exportalex"
Please try to use terminal and hit this: flutter pub get
You need to load all the dependency before run app.
If still you are facing same issue, please run: flutter doctor
Then share screenshot of result.

Flutter create command was unsuccessful error

I'm creating a new flutter project in Android studio. I give the project a name and choose Flutter application. I then clicked finish and then nothing happened.
Android studio says that
"Flutter create command was unsuccessful"
When I navigate to command directory using file explorer, a new folder is created with the project name I've given but it is empty.
Please help.
A simple Android Studio restart did the trick for me
I've solution to this problem now.
After running flutter doctor --android-licenses I got to know that I need to update my sdkManager.
Then I went to that directory using
cd C:\Users\[user-name]\AppData\Local\Android\Sdk\tools\bin
and run sdkmanager --update
Then I restarted the Android Studio and tried creating flutter project.
It worked.
check your FLUTTER SDK path of the project (android studio: file -> settings -> Language & framework -> flutter -> flutter sdk path) . Or execute flutter doctor command in flutter consol.(This worked for me)
please install all the dependencies that flutter wants
Operating Systems: Linux (64-bit)
Disk Space: 600 MB (does not include disk space for IDE/tools).
Tools: Flutter depends on these command-line tools being available in your environment.
*bash
*curl
*file
*git 2.x
*mkdir
*rm
*unzip
*which
*xz-utils
*zip
Shared libraries: Flutter *test command depends on this library being available in your environment.
libGLU.so.1 - provided by mesa packages such as libglu1-mesa on Ubuntu/Debian and mesa-libGLU on Fedora
Look at Flutter sdk path while Creating the Project.
$ C:\flutter
If your Flutter SDK is updated and the path is right you will get a solution.
Check your Flutter SDK path.
Check the package name. It must be in lower case.
Restart your IDE and check again.

Where is Dart's SDK located within /flutter folder?

Software
MacOS Sierra 10.12.6
Android Studio 3.1.2
Flutter 0.3.2 • channel beta
Tools • Dart 2.0.0-dev.48.0.flutter-fe606f890b
Flutter doctor (no problems found)
Problem
Dart's SDK is supposed to be bundled when Flutter is downloaded according to the documentation:
"The Dart SDK is bundled with Flutter; it is not necessary to install Dart separately"
However, I opened an existing Flutter project with Android Studio and it suggested me to either "Download Dart SDK" or "Open Dart settings":
Apparently, I need to "Open Dart settings" and tell Android Studio where to find the Dart' SDK. However, it can't find it within the flutter/ directory.
The Dart SDK lives inside the bin/cache/dart-sdk folder of the Flutter SDK. It will be downloaded the first time you run the flutter command, so may not exist if you've not yet run flutter.
The Dart's SDK is located at /flutter/bin/cache/dart-sdk
However, If Android Studio's flutter plugin is installed, the plugin needs to be told where flutter's SDK is located. Android Studio should be able to locate Dart's SDK afterwards:
I have downloaded flutter sdk via homebrew
For Mac OS: 10.14.5
Android Studio version : Arctic Fox 2020.3.1
Flutter sdk location is /usr/local/Caskroom/flutter/2.5.0/flutter
Dart location: /usr/local/Caskroom/flutter/2.5.0/flutter/bin/cache/dart-sdk
After installing flutter however you choose.
run the following command
flutter sdk-path
In Android-Studio select File->Setting->Languages & Frameworks->Flutter
(assuming you have installed teh flutter plugin)
Populate the "Flutter SDK path:" with the result from (1).
Click apply. The Dart SDK should automatically get populated.
For my installation the values are:
Flutter SDK path: /home/andrew/snap/flutter/common/flutter
Dart SDK path: /home/andrew/snap/flutter/common/flutter/bin/cache/dart-sdk
If someone is looking for the path to flutter sdk in Linux I found mine here
/home/your_username/flutter/common/flutter/ flutter path
/home/your_username/flutter/common/flutter/bin/cache/dart-sdk dart path
Run brew info flutter
Then you get the path: e.g.
/opt/homebrew/Caskroom/flutter/2.5.3
And there the bin/cache has the dartk-sdk:
/opt/homebrew/Caskroom/flutter/2.5.3/flutter/bin/cache/dart-sdk
If you installed Dart on Windows via Chocolatey, you will find it on C:\tools\dart-sdk
I have faced this issue,
Go to the folder where you have downloaded flutter and then delete the flutter folder.
Go to your download folder and where you have downloaded the flutter the first time.
Extract this file again where you have deleted the flutter...
This is working for me.
Sometimes it is the build directory that he cannot create, suddenly devtools crashes, you can simply recreate it in $HOME/.pub-cache/hosted/pub.dartlang.org/devtools-your-version, then give it the right rights with for example sudo chown -R $USER:$USER $HOME/.pub-cache/hosted/pub.dartlang.org/devtools-your-version/build after re-creating the build directory
Check this:
brew info dart
Output:
Please note the path to the Dart SDK: /opt/homebrew/opt/dart/libexec
If Android Studio show - Error: Dart SDK is not configured.
Open console and write: flutter sdk-path. Copy output.
Next Settings (Ctrl+Alt+S) => Languages & Frameworks => Flutter => Flutter SDK path.
Paste SDK path.
Everyone that is still searching for the correct answer should checkout this answer https://stackoverflow.com/a/63409260/9823820.
If you have the flutter SDK installed.
Run:
flutter doctor -v
The first line will show the install path.
Credits go to #Lee Higgins

Resources