17

I have installed Flutter on Windows and checked all is ok using flutter doctor. I imported the Flutter plugin.

Now, when I try to create a new Flutter app via Anroid Studio it never ends. I get "Creating Flutter Project" and that's it.

The message area contains ""C:\Program Files\Flutter\flutter\bin\flutter.bat" --no-color create --template app --description "A new Flutter application." --org anykey.co.il flutter_app4" It seems to be stuck on "Building symbols...".

I even left it on overnight hoping it would finish.

In the end I have to kill it.

Edit: It seems that my flutter.bat file is looping. I tried flutter doctor (who echo set to on) and this is what I get. The last part loops forever.

C:\Users\user>flutter doctor

C:\Users\user>REM Copyright 2017 The Chromium Authors. All rights reserved.

C:\Users\user>REM Use of this source code is governed by a BSD-style license that can be

C:\Users\user>REM found in the LICENSE file.

C:\Users\user>REM ---------------------------------- NOTE ----------------------------------

C:\Users\user>REM

C:\Users\user>REM Please keep the logic in this file consistent with the logic in the

C:\Users\user>REM `flutter` script in the same directory to ensure that Flutter continues to

C:\Users\user>REM work across all platforms!

C:\Users\user>REM

C:\Users\user>REM --------------------------------------------------------------------------

C:\Users\user>SETLOCAL ENABLEDELAYEDEXPANSION

C:\Users\user>FOR %i IN ("C:\Program Files\Flutter\flutter\bin\..") DO SET FLUTTER_ROOT=%~fi

C:\Users\user>SET FLUTTER_ROOT=C:\Program Files\Flutter\flutter

C:\Users\user>SET flutter_tools_dir=C:\Program Files\Flutter\flutter\packages\flutter_tools

C:\Users\user>SET cache_dir=C:\Program Files\Flutter\flutter\bin\cache

C:\Users\user>SET snapshot_path=C:\Program Files\Flutter\flutter\bin\cache\flutter_tools.snapshot

C:\Users\user>SET stamp_path=C:\Program Files\Flutter\flutter\bin\cache\flutter_tools.stamp

C:\Users\user>SET script_path=C:\Program Files\Flutter\flutter\packages\flutter_tools\bin\flutter_tools.dart

C:\Users\user>SET dart_sdk_path=C:\Program Files\Flutter\flutter\bin\cache\dart-sdk

C:\Users\user>SET engine_stamp=C:\Program Files\Flutter\flutter\bin\cache\engine-dart-sdk.stamp

C:\Users\user>SET engine_version_path=C:\Program Files\Flutter\flutter\bin\internal\engine.version

C:\Users\user>SET pub_cache_path=C:\Program Files\Flutter\flutter\.pub-cache

C:\Users\user>SET dart=C:\Program Files\Flutter\flutter\bin\cache\dart-sdk\bin\dart.exe

C:\Users\user>SET pub=C:\Program Files\Flutter\flutter\bin\cache\dart-sdk\bin\pub.bat

C:\Users\user>REM If available, add location of bundled mingit to PATH

C:\Users\user>SET mingit_path=C:\Program Files\Flutter\flutter\bin\mingit\cmd

C:\Users\user>IF EXIST "C:\Program Files\Flutter\flutter\bin\mingit\cmd" SET PATH=C:\Program Files\Git\cmd;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Android\android-sdk\platform-tools;C:\Program Files\Calibre2\;C:\Program Files\Java\jre7\bin\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Git\cmd;c:\Program Files (x86)\PuTTY;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\rexx.org\Regina;C:\Program Files\Git\cmd;C:\Users\user\AppData\Local\Microsoft\WindowsApps;C:\Users\user\AppData\Roaming\Dashlane\4.6.8.26847\bin\Firefox_Extension\{442718d9-475e-452a-b3e1-fb1ee16b8e9f}\components;C:\Program Files\Flutter\flutter\bin;;C:\Program Files\Flutter\flutter\bin\mingit\cmd

C:\Users\user>REM Test if Git is available on the Host

C:\Users\user>where /q git   || ECHO Error: Unable to find git in your PATH.   && EXIT /B 1

C:\Users\user>REM  Test if the flutter directory is a git clone, otherwise git rev-parse HEAD would fail

C:\Users\user>IF NOT EXIST "C:\Program Files\Flutter\flutter\.git" (
ECHO Error: The Flutter directory is not a clone of the GitHub project.
 EXIT /B 1
)

C:\Users\user>REM Ensure that bin/cache exists.

C:\Users\user>IF NOT EXIST "C:\Program Files\Flutter\flutter\bin\cache" MKDIR "C:\Program Files\Flutter\flutter\bin\cache"

C:\Users\user>REM To debug the tool, you can uncomment the following lines to enable checked mode and set an observatory port:

C:\Users\user>REM SET FLUTTER_TOOL_ARGS="--checked "

C:\Users\user>REM SET FLUTTER_TOOL_ARGS=" --observe=65432"

C:\Users\user>(
REM "3" is now stderr because of "2>NUL".
 CALL :subroutine doctor   2>&3 9>"C:\Program Files\Flutter\flutter\bin\cache\flutter.bat.lock"  || GOTO acquire_lock
) 2>NUL

C:\Users\user>(
REM "3" is now stderr because of "2>NUL".
 CALL :subroutine doctor   2>&3 9>"C:\Program Files\Flutter\flutter\bin\cache\flutter.bat.lock"  || GOTO acquire_lock
) 2>NUL

Second edit:

Output of "flutter doctor -v"

    [v] Flutter (Channel beta, v0.1.5, on Microsoft Windows [Version 10.0.16299.248], locale en-US)
    • Flutter version 0.1.5 at C:\Program Files\flutter
    • Framework revision 3ea4d06340 (13 days ago), 2018-02-22 11:12:39 -0800
    • Engine revision ead227f118
    • Dart version 2.0.0-dev.28.0.flutter-0b4f01f759

[v] Android toolchain - develop for Android devices (Android SDK 26.0.2)
    • Android SDK at C:\Users\user\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-26, build-tools 26.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[v] Android Studio (version 3.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[v] Connected devices (1 available)
    • Nexus 10 • R32F201H9ME • android-arm • Android 5.1.1 (API 22)

• No issues found!
9
  • Does ’flutter create flutter_app4` in a shell work? Commented Mar 6, 2018 at 19:06
  • @GünterZöchbauer Trying it now. How long should it take? If less than a minute then it is not working. :( Commented Mar 6, 2018 at 19:19
  • Ok, so it's not related to the IDE, but only to your Flutter setup. What output does flutter doctor -v produce? Commented Mar 6, 2018 at 19:22
  • So, now flutter doctor is not finishing either. It seems to be in some sort of a loop. I added "echo on" to see. The output is in my update above. Commented Mar 6, 2018 at 20:02
  • I'm not able to make sense from this output. I'd try reinstalling Flutter (no a sophisticated answer, I know) Commented Mar 6, 2018 at 20:09

13 Answers 13

16

Had the same issue.

Just run Android Studio/IntelliJ in administrator mode. It works.

Sign up to request clarification or add additional context in comments.

2 Comments

it works perfectly but may I know what are the possible reasons. Its not good running android studio each time as administrator
@muhammadobaid Sorry for the really late reply. I haven't been using flutter for a while. Regarding your question, I believe it was because flutter was installed into a restricted storage space (I guess its the C drive here)
7

For windows 10 there is couple of solution here, I am sharing with here which is working for me.

1. Set Flutter SDK path is present in AS Settings . Settings > Languages & Settings > Flutter > Flutter SDK Path

2. Run Android Studio/IntelliJ in administrator mode

3. Your project location path folder name is valid Dart package name.

1 Comment

Right! As usual It's clear, if the Flutter SDK is located in C:\, Android Studio cannot run flutter, because it requires administrator's grants. So, open it with them and create your project.
5

This is likely because you've put Flutter in Program Files which requires admin permissions to be able to write its cache files.

I've got a PR Open that should result in a more friendly error, but I'd recommend moving Flutter away to a folder that non-Admin users can write to.

Comments

3

In my case this was the issue - I checked create project offline checkbox. Please sure that this checkbox is unchecked.

enter image description here

Comments

3

After selecting options and when "creating new Flutter project" appeared, end Android Studio process and re-run it then - instead of creating a project- choose Open Project and select the project folder that you created before .

Comments

1

I was struck with the same problem a while back. After a lot of stumbling I got it right. First of all delete your previous cloned flutter files and install git in your user folder. Like C:\users\username\

Clone flutter in your git directory,set the path C:\users\username\git\flutter\bin

Now use the command flutter doctor If you have android studio and intellij IDE, install flutter plugins in both of them and now create a new project.

You are all set to go

Comments

1

For me this worked in Windows 10 :

  • Flutter SDK location : kept it under c:\Users<username>\AppData\Local
  • Project location : kept it under c:\Users<username>\AppData\Local
  • Start Android Studio in Administrator mode : this was not required it worked without Administrator privilege
  • While creating the new Flutter project : create project offline choose this option (another answer in this same post which has a screenshot says, do not select it, but for me it worked only after selecting this option)

How much time it took to create the project ? 2 minutes

Comments

0

I had same issue on windows 10 . Make sure path of the Flutter SDK is present in AS Settings . Settings > Languages & Settings > Flutter > Flutter SDK Path

Comments

0

I have disabled the Antivirus(Quick Heal), and run the CMD as administrator and run "flutter" command. It's working. Then checked the "flutter doctor" command, It's also working fine.

Then started the AS as administrator mode and create the flutter app and it's started working now.

Comments

0

in windows try to run android studio as administrator and create new flutter project

Comments

0

It might sometimes be as a result of the current version of Flutter and Dart plugins. Check the plugins and update if requested. File >> Settings >> Plugins

Comments

0

I also get this same issue. close the android studio from task manager and run cmd as administrator. now type

taskkill /F /IM dart.exe

and press enter. Now run your ide and create a flutter project. I solved this problem in this way

Comments

0

The solution which worked for me in windows.

I have placed flutter sdk folder in C:\Program Files.

When android studio try to access the folder, it wont work as admin rights is required for that folder.

  1. Run android studio as administrator and create a new project
  2. Else flutter sdk can be placed in User folder C:\users\username\flutter or other drives which does not require elevated rights.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.