I am following Flutter official documentation for adding flutter Path in .bash_profile in order to run commands on terminal but it give me error
-bash: flutter: command not found
Is there any quick way to add Flutter support in android studio for was Android Developers. I am trying to find the easy way to add Flutter support on running Android environment.
My .bash_profile contains the following line:
export PATH="$PATH:$HOME/Developer/flutter/bin"
I have tried all my possible answers but no luck.
P.S I'm using bash not zsh any other.
I have faced the same issue. I assume that you've downloaded the flutter SDK from official docs as I did and tried so many solutions.
I resolved this issue with the following steps:
download the Android Studio
Open Android studio's preferences -> Plugins -> download flutter plugin
File -> New -> Create New Flutter project
In the next dialogue under the "Flutter SDK path" you can see install SDK... option (install the SDK from there at your desired location)
Once SDK is installed then update your .bash_profile with the newly downloaded SDK.
Your .bash_profile should look something like this:
export PATH="$PATH:$HOME/Developer/flutter/bin"
Related
I installed flutter and it was working fine but after updating it to recent version, flutter is not able to find the android sdk manager. I've tried running flutter doctor and tried to install android licenses but the error "Android Sdkmanager not found is shown". I've attached the image of my command prompt here.
Here's what I've already tried but didn't worked...
I had cmd tools installed in my android studio, so I uninstalled and reinstalled it.
Changed path settings, added my sdk path to environment variables.
Also added cmd tool path to system variables.
Deleting the cmd tools and downloading it from android studio official site and pasting it into the sdk manager folder.
Changing the sdk path to the sdk manager folder path in command prompt.
Running command prompt as administrator.
I've attached the image of command prompt with 'flutter doctor -v' here
I've tried almost everything I found on google but nothing seems to solve my problem. I don't know what should I do next and I'm stuck in it from two days.
Here's the flutter doctor --android-licenses -v image
Please help, Thanks.
First, make sure to follow the official documentation step by step to install and set up Android SDK for Windows (Maybe uninstall first everything from before to remove any kind of conflict that exist). Also, don't install the Command line tools only and include it to PATH (Remove every related Android SDK PATH or even other environment variables that are still there too). The recommended way is inside the Android Studio in Preferences -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools and select Android SDK Command-line Tools.
Second, make sure you restart the command prompt for the changes to take effect. For example, changing PATH doesn't update the running processes. So, just restart the ones that need the new configurations. Sometimes even restart the entire system so every process has the updated configurations.
And then try again to accept the licenses:
flutter doctor --android-licenses
I found the solution to my problem stated above, the android sdkmanager.bat file was getting deleted automatically by an antivirus named "SAntivirus". I uninstalled the file from my program files and it worked. Now my flutter doctor is working fine and accepted all the licenses. Thank you all for your support.
you should install the android sdk command line tools in sdk tools on your android studio ( uncheck the hid obselute pacakges ).
Hi I have followed the official documentation for setting up the React native project on windows.
I have added the ANDROID_HOME variable as system variable at location
"C:\Users\AKSHAY\AppData\Local\Android\Sdk"
In the second step I was supposed to add Environment variable at
"C:\Android\tools\bin\platform-tools"
but there is no tools folder in Android instead I found platform-tools under SDK below is the location
"C:\Users\AKSHAY\AppData\Local\Android\Sdk\platform-tools"
Now when I am running
npx react-native run android
I am getting the below attached error
Here is the SDK folder
Please help.
setup an android emulator first with avd
if your RN >=.62
You can run npx react-native doctor inside your project folder
else
run npx #react-native-community/cli doctor inside your project folder
This command checks your environment and displays a report of the status of react native installation. Check the output carefully for other software you might need to install.
You can install android studio then add ANDROID_HOME to your ENV Variable and point to your SDK.
Follow this link: https://web.archive.org/web/20180210044548/http://spring.io/guides/gs/android/
The path you are looking for is located at :
C:\Users\"yourUser"\AppData\Local\Android\Sdk\platform-tools
I looked all over Google and Stack Overflow for an answer, but I couldn't find the right one for me. I am learning Cordova and I'm trying to run the android emulator through terminal, and when I run 'sudo cordova emulate android' I get this message:
''Failed to find 'ANDROID_HOME' environment variable. Try setting it manually.
Detected 'avdmanager' command at /Users/username/Library/Android/sdk/cmdline-tools/latest/bin but no 'tools/bin' directory found near.
Try reinstall Android SDK or update your PATH to include valid path to SDK/tools/bin directory.''
But I set the variables in the ~./bash_profile file and it looks like this:
export ANDROID_HOME="/Users/username/Library/Android/sdk"
export ANDROID_SDK_ROOT=$ANDROID_HOME
export PATH=${PATH}:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools
export PATH=${PATH}:$ANDROID_HOME/tools/bin
export PATH="$PATH:$ANDROID_HOME/build-tools/30.0.0-rc2"
I am using a MacOS Mojave, does anyone know what the issue is?
Thanks in advance
Apparently, in the latest version of Android Studio, the old SDK tools (under /tools, which Cordova seems to expect) are already considered obsolete. There is a solution documented here on how to install the old version of SDK tools.
Open Android Studio
Open Tools -> Sdk Manager
Click on the Sdk Tools Tab
Uncheck Hide Obsolete Packages
Check Android Sdk Tools (Obsolete)
Click Apply
This should download the old SDK tools under the correct folder.
However, I think Cordova also needs to keep up with the newest Android development tools. There's another change I needed to make after this:
I had to delete the tools/emulator and tools/emulator-check binaries, and add $ANDROID_HOME/emulator to my $PATH, since the current emulator binary lives under emulator/emulator instead of path/emulator. See this post.
Then I was finally able to launch the app directly via Cordova.
I'm installing flutter in my Ubuntu 18.10. I'll be using Visual Studio Code for flutter development. I've not installed Android Studio.
I've downloaded Android Command line tools from official android site and extracted it in a separate folder in Documents/development/android
I set the path for ANDROID_HOME in the bashrc file by following the flutter documentation
Here is the .bashrc file
And the Android toolchain error
It seems that , you set the ANDROID_HOME variable but it is not added to PATH.
Make sure you add the ANDROID_HOME to the path as below
export PATH=$PATH:$ANDROID_HOME/bin
and re-launch the console.
update
In order for Android SDK to work fine, you need to set path for the below SDK packages.
..android-sdk\tools
..android-sdk\platform-tools
and your ANDROID_HOME will be
..android-sdk
I am not sure what you are referring to when you are saying that you have downloaded Android Command Line tools. From the output in your terminal, it tells me that you do not have the SDK files in your machine. To download the Android SDK, please see this link here and download the tar file that matches your operating system. Then extract the tar file in the folder which you have set as ANDROID_HOME. This should work fine.
In case you are having the same error, I strongly recommend downloading the Android Studio and install the Android SDK through the Android Studio. The flutter documentation says so as well. You can always uninstall or remove Android Studio after it is being installed and if you are not considering using it.
please replace yout android sdk in thatway this is default installation location of sdk C:\Users\Intel\AppData\Local\android\android_sdk
I already had Android Studio and the Android SDK installed. I later added Flutter and the Flutter SDK. Here is my problem: When I run
flutter doctor
It shows,
that I do not have the Android SDK installed.
You can configure the Android SDK for your project using
flutter config --android-sdk /path/to/android/sdk
The PATH variable also should contain the SDK, like
export PATH=$PATH:/usr/local/opt/android-sdk/emulator:/usr/local/opt/android-sdk/build-tools/26.0.1:/usr/local/opt/android-sdk/platform-tools:/usr/local/opt/android-sdk/tools
/usr/local/opt/android-sdk and 26.0.1 might not match your system. That's just an example.
Step-by-step guidance for Windows with pictures
Step 1.
If you see this error, it means Flutter does not locate your Android SDK.
There are two folders containing all files of the "Android SDK". They are "Platform" and "Platform Tools":
Those folders are located in my computer here:
C:\Users\ZohaibSaleem\AppData\Local\Android\Sdk
(My name is Zohaib Saleem, and you should replace my username folder name with your computer username.)
Step 2
Type "Env" in the search bar of Windows
Click on "System Variable Environment"
Click on "Advanced and Environment Variable"
Go to System Variable → Path → Edit:
Now paste the path of both folder "platform" and "platform-tools", respectively.
In my case, the paths are:
C:\Users\ZohaibSaleem\AppData\Local\Android\Sdk\platforms
C:\Users\ZohaibSaleem\AppData\Local\Android\Sdk\platform-tools
After adding the path to your System variable it looks like:
Click OK
Restart PowerShell and again run the command "flutter doctor".
Now, the Android SDK problem is resolved, but you faced another problem:
To resolve this issue, just run the command
flutter doctor --android-licenses
And accept all with "Y". At the end, after typing multiple 'Y's, again run 'flutter doctor' and all is set!
flutter config --android-sdk /your path
example
flutter config --android-sdk /root/Android/Sdk
Tools > SDK Manager > Android SDK
images
Locate the Android SDK folder (e.g., D:\SDK).
Add platforms (D:\SDK\platforms) and platform-tools (D:\SDK\platform-tools) to the PATH variable.
Run flutter doctor. It should not show any errors or warnings.
For this issue you have to add three variables to the Path in the:
C:\Users\admin\AppData\Local\Android\platforms // The path to
platform
C:\Users\admin\AppData\Local\Android\platform-tools //
The path to platform-tool
C:\Users\Admin\AppData\Local\Android\emulator // The path to
emulator