Flutter create command was unsuccessful - android-studio

I'm creating a new flutter project in Android studio for the first time. I give the project a name and choose Flutter sdk. I then clicked finish and then noting happened. Android studio says that
"Flutter create command was unsuccessful"
When I navigate to command directory using file explorer, I new folder is created with the project name I've given but it is empty.
Please help.

I don't think you installed flutter correctly. First and foremost, make sure you run flutter doctor from your terminal.
If it doesn't work then you didn't install flutter properly.
If it works, try creating your project via terminal by typing flutter create projectname

I hade the same issue in ubuntu
first, check flutter doctor and solve the error if there was
then check the git installation
in my case, I didn't install git

On Windows at least you need to add <flutter_dir>\bin to your path, and then restart Android Studio. It is not clear to me why Android Studio needs to know the location of the Flutter SDK if it doesn't then use that information but... :shrug:
Git also needs to be in the PATH too (as C:\Program Files\Git\cmd); I have always used git-bash just fine without that but now it seems to be a requirement that isn't clearly surfaced when upgrading.

In My case set the flutter sdk path first while create the app and then create the app

Related

I try to make android studio (emulator) work with vs-code but have an error "avdmanager is missing from the Android SDK"

This is my PATH
export ANDROID_SDK_ROOT=/mnt/sda1/DevTools/sdk/
export ANDROID_HOME=$ANDROID_SDK_ROOT
export PATH=${PATH}:/mnt/sda1/DevTools/sdk/platform-tools
I try many cases, but still this error!
Try :
flutter doctor --android-licenses
if something wrong, try to locate android sdk path.
flutter config --android-sdk {path}
Mine :
flutter config --android-sdk C:\Android\Sdk
This worked for me. If you have sdkmanager, avdmanager and emulator, and you have them in your PATH environmental variable, then
Download a system image:
sdkmanager "system-images;android-30;google_apis_playstore;x86_64"
(you can find available packages with sdkmanager --list --verbose)
Create a new virtual device with
avdmanager create avd --name MyAndroidDevice --package "system-images;android-30;google_apis_playstore;x86_64"
Start the emulator
emulator -avd MyAndroidDevice
Now restart VSCode and open your Flutter project. The new device should be at the bottom right corner or you should be able to choose it by clicking on "No device".
For me, I had to restart my VS Code for the installation of Android SDK be reflected upon it.
I know this is an old question but setting my $PATH variable in ~/.bashrc (I'm on Ubuntu 20.04) did not work for me.
I needed to setup Android Emulator for VScode, because I wanted to run my flutter app, which seems to be the same issue as OP had.
Instead of setting the $PATH directly you can actually use Flutter in the terminal to do it.
If you run "flutter config" in the terminal you get something like:
Configure Flutter settings.
To remove a setting, configure it to an empty string.
The Flutter tool anonymously reports feature usage statistics and basic crash reports to help
improve Flutter tools over time. See Google's privacy policy:
https://www.google.com/intl/en/policies/privacy/
....
Run "flutter help" to see global options.
Settings:
android-sdk: <my_path_to_android_tools>
Analytics reporting is currently enabled.
You can then see the $PATH that is currently set with flutter under:
Settings:
android-sdk: <my_path_to_android_tools>
Mine was incorrect so I changed it to the current one with the command:
flutter config --android-sdk <my_path_to_android_tools>
Afterwards I restarted VScode and when it was finished loading I could now press the "device" button in the right hand corner and then select emulator that I had already created. I used one of the above answers to install the emulator itself.
It took a while to launch the emulator the first time due to installing some dependencies but it did work!
I tried this and works:
from terminal run flutter config --enable-android. You will get Setting "enable-android" value to "true".
after that open android studio, set up virtual devices first if you haven't. Open Android Studio -> Configure -> AVD Manager -> Create Your Virtual Device
Go back to your VS Code, open command Palette (Ctrl+P or cmd+P, then type >), or from View -> Command palette... -> Flutter: Select Device -> choose your android device
I faced the same issue and solved it running flutter doctor from the terminal, in VS Code. In my case, I had the android sdk located in a custom location (D drive), the reason why it wasn't found automatically. The "doctor" told me to run flutter config --android-sdk <my-sdk-custom-location>. Running it and restarting the IDE made the trick. Hopefully this helps someone facing the same problem.

Cannot create flutter project or run flutter project in Android studio. (flutter works fine)

I'm getting into flutter so I followed the install doc on the website and had no issue, installed the flutter and dart plug-ins on both Android Studio and Intelli J. The flutter doctor -v command results in the following
But yet when I try to create a new flutter project in Android Studio a folder is created with the project name but it is empty and I get the following in the event button on the welcome screen.
Error creating project
Flutter create command was unsuccessful
So I decided to create the project manually in gitbash where the create command worked perfectly.
I opened the project in Android Studio and discovered another problem even with the emulator running or phone attached the devices section of the run ribbon displays no device and always says loading in the dropdown when clicked.
So again I opened gitbash and in the project root folder type flutter run and the default flutter test app appeared on the emulator.
In Summary, Android studio can open but not create the project nor can it run it but the project can be run from gitbash on the emulator I launched from Android studio.
BTW: IntelliJ has a similar result when creating a project.
I have no idea what was causing the issue but a fresh install of Git seems to have resolved the issues.

ios/mac - Android Studio: Flutter SDK path doesnt set

Steps to Reproduce:
1. Open Android Studio IDE on Mac (Flutter plugin already installed)
2. Android Studio > Preferences.. > Language & Frameworks > Flutter
3. Section SDK: Set Flutter SDK path
4: Press Apply
Expected:
Path should be set and remain in the text box
Actual:
Path disappears from Flutter SDK path text box, no path is set and cant go on programming
As I work on a group project, i regulary have to pull from github. After every pull, i had to reset the Flutter SDK path (dont really know why but it kept disappearing). It used to work just fine until some days ago, the behavior explained on top started. Any help would be really appreciated!
Video: http://sendvid.com/vlt9ykpz
If someone else has the same problem: Deleting the local copy and pulling the whole project from git again fixed the issue in my case. Just dont forget to copy your local changes as the would be deleted aswell
I ran into this while moving the location of the Flutter SDK.
After all the files were in place, restarting the IDE showed the correct path after it had been disappearing before restart.
C:\dev\tools\flutter_sdk\flutter (folder that contains flutter\bin)
Don't commit the android/local.properties file (add it to .gitignore)
or update the path using flutter config --android-sdk path after checkout.
having the same issue on ubuntu 20, installed flutter with snapd

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.

New version of Android Studio is not opening

I recently downloaded a new version of Android Studio, but after installation of the program, it asked options like to create new projects or others as I click on the project structure where I had to locate the path of the SDK. After locating its path correctly, it just froze. Nothing happens when I click the create a new project option. Instead of this, I clicked open the current project option. Android Studio opened, but without the SDK settings. When I go to the SDK manager to locate the path of SDK, that SDK manager option is not loading. It keeps on loading and shows nothing.
This problem is only related to the new version, not with the Android Studio 1.5. What should I do to solve this problem?
i hope this command help you!!
For linux
open Terminal
Follow this commmand
cd /media/ubuntu/DATA/android-studio/bin
./studio.sh
For Windows
Follow this commmand
cd /media/ubuntu/DATA/android-studio/bin
./studio.sh

Resources