Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliJ IDEA stuck on "Creating Flutter Project" #1855

Closed
tochanenko opened this issue Feb 28, 2018 · 17 comments
Closed

IntelliJ IDEA stuck on "Creating Flutter Project" #1855

tochanenko opened this issue Feb 28, 2018 · 17 comments

Comments

@tochanenko
Copy link

tochanenko commented Feb 28, 2018

Steps to Reproduce

  1. Open IntelliJ IDEA
  2. Goto File->New Project and select Flutter (SDK path is correct)
  3. Click on Next and Finish

Then it starts looping. It has been doing something for about one hour.

Version info

[√] Flutter (on Microsoft Windows [Version 10.0.16299.248], locale ru-RU, channel beta)
    • Flutter version 0.1.4 at C:\Windows\System32\flutter
    • Framework revision f914e701c5 (9 days ago), 2018-02-19 21:12:17 +0000
    • Engine revision 13cf22c284
    • Dart version 2.0.0-dev.27.0-flutter-0d5cf900b0

[√] Android toolchain - develop for Android devices (Android SDK 23.0.3)
    • Android SDK at C:\Users\Владислав\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-23, build-tools 23.0.3
    • Java binary at: D:\Android\Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[√] Android Studio (version 3.0)
    • Android Studio at D:\Android\Studio
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[√] IntelliJ IDEA Community Edition (version 2017.3)
    • Flutter plugin version 22.2.2
    • Dart plugin version 173.4548.30
@tochanenko tochanenko changed the title IntelliJ IDEA stuck on "Crating Flutter Project" IntelliJ IDEA stuck on "Creating Flutter Project" Feb 28, 2018
@devoncarew
Copy link
Member

Can you check your IntelliJ log file to see if there are any exceptions (likely near the end)? Or, any suspicious entries?

You could also try enabling the 'verbose' option in the Flutter preference page (Preferences > Languages and Frameworks > Flutter), then re-run the project create step and again check the log.

Does project creation work on the cli? flutter create foo_bar

@tochanenko
Copy link
Author

tochanenko commented Feb 28, 2018

@devoncarew
That is quite interesting

Creating project foo_bar...
 Writing files
Wrote 66 files.

Running "flutter packages get" in foo_bar...
Failed to rename directory because access was denied.
This may be caused by a virus scanner or having a file
in the directory open in another application.
pub get failed (1)

So I tried disabling Kaspersky and that changed a lot

Creating project foo_bar_2...
// Writing files
Wrote 66 files.
Running "flutter packages get" in foo_bar_2...       14,2s

[√] Flutter is fully installed. (on Microsoft Windows [Version 10.0.16299.248], locale ru-RU, channel beta)
[√] Android toolchain - develop for Android devices is fully installed. (Android SDK 23.0.3)
[√] Android Studio is fully installed. (version 3.0)
[√] IntelliJ IDEA Community Edition is fully installed. (version 2017.3)
[!] Connected devices is partially installed; more components are available.

Run "flutter doctor" for information about installing additional components.

All done! In order to run your application, type:

  $ cd foo_bar_2
  $ flutter run

Your main program file is lib/main.dart in the foo_bar_2 directory.

But creating projects via IntelliJ IDEA is still endless. I looked into log and I found these lines quite strange:

[  17525]   INFO -       ScriptTemplatesProviders - [kts] loading script definitions [] using cp:  
[  17528]   INFO -       ScriptTemplatesProviders - Templates provider KotlinCompilerScriptTemplatesSettings is invalid:  
[  17557]   INFO -       ScriptTemplatesProviders - Templates provider Gradle Kotlin DSL is invalid: Unable to get Gradle home directory 
[  17558]   INFO -       ScriptTemplatesProviders - Templates provider Gradle Kotlin DSL is invalid: Unable to get Gradle home directory 
[  17558]   INFO -       ScriptTemplatesProviders - Templates provider Gradle Script Kotlin is invalid: Unable to get Gradle home directory 

And then it says:
2018-02-28 22:00:37,408 [  19578]   INFO - tor.impl.FileEditorManagerImpl - Project opening took 6554 ms 
2018-02-28 22:00:38,279 [  20449]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 3041ms; general responsiveness: ok; EDT responsiveness: 1/3 sluggish, 1/3 very slow 
2018-02-28 22:00:38,635 [  20805]   INFO - j.ide.plugins.RepositoryHelper - using cached plugin list (updated at 28.02.2018 20:33) 
2018-02-28 22:00:38,651 [  20821]   INFO - j.ide.ui.OptionsTopHitProvider - 165 ms spent to cache options in project 
2018-02-28 22:00:39,571 [  21741]   INFO - CompilerWorkspaceConfiguration - Available processors: 8 
2018-02-28 22:00:41,777 [  23947]   INFO - ellij.project.impl.ProjectImpl - 20 project components initialized in 36 ms 
2018-02-28 22:04:29,358 [ 251528]   INFO - ellij.project.impl.ProjectImpl - 150 project components initialized in 116 ms 
2018-02-28 22:04:29,359 [ 251529]   INFO - le.impl.ModuleManagerComponent - 0 module(s) loaded in 0 ms 
2018-02-28 22:04:39,793 [ 261963]   INFO - #io.flutter.sdk.FlutterCommand - C:\Windows\System32\flutter\bin\flutter.bat [--no-color, create, --template, app, --description, A new Flutter project., --org, com.yourcompany, untitled2] 

image

UPD. I checked 'verbose' in Preferences and now it says "Flutter create command was unsuccessfull"
Then I run 'flutter doctor' and it says that everything is OK

@tochanenko
Copy link
Author

@stevemessick
Copy link
Member

I'm not a Windows user and this may be totally irrelevant. Having Flutter installed in

C:\Windows\System32\flutter

seems incorrect and could lead to problems.

See Get Started: Install on Windows.

@guyulmaz
Copy link

guyulmaz commented Apr 2, 2018

Running "flutter packages get" in foo_bar...
Connection terminated during handshake
pub get failed (69)

I think firewall is restricting access to some paths.
Do you know for which urls this exception should be added at firewall?

@pq pq added this to the M24 milestone Apr 9, 2018
@devoncarew devoncarew modified the milestones: M24, Backlog Apr 11, 2018
@handstandsam
Copy link

I finally got around this. You can diagnose via creating a new project via the command line, and then running an update packages to diagnose proxy issues. NOTE: I had to set a system wide proxy to make this work.

  1. Create a flutter project: flutter create foo_bar

  2. Run get packages: flutter packages get -v

I found out here that my proxy information was bad. I added an the following to my ~/.bash_profile, closed the terminal and Android Studio, and then reopened both.
http_proxy="http://user:pass@myproxy.com:8080"

@madarinho
Copy link

Try to "Run as administrator" your IDE.
It worked for me on Android Studio.

@darylrue
Copy link

darylrue commented Jun 5, 2018

I have the same issue when creating a new Flutter project while at work, where the network has a man-in-the-middle firewall. Something is being blocked, but instead of failing gracefully, IntelliJ is hanging indefinitely.

@MishraUdit
Copy link

I had the same issue also. When I connected my system to the internet, it completed the task in a few seconds...
I don't know what's the issue behind it, but I think it requires proper bandwidth while creating new projects.
Might be, it is downloading a few files or authenticating any file each time creating new projects.

@nabinbhandari
Copy link

I also had the same issue, In my case, I think, it was caused because the process 'dart' was already running in the background. In Linux terminal, I entered killall dart to kill the process and then I was able to create a new project.

@darylrue
Copy link

Using my work computer on my home network I'm now having the same issue. If I run
flutter create test_project
it hangs here:
Running "flutter packages get" in test_project...
If I go to an existing flutter project and run
flutter packages get -v
it hangs here:
[C:\Users\path_to_project\] c:\flutter\bin\cache\dart-sdk\bin\pub.bat --verbosity=warning --verbose get --no-precompile

@zoechi
Copy link

zoechi commented Sep 4, 2018

flutter/flutter#16659 mentions

oh ,thanks i t was due to version 32 bit of windows,thanks alot

@skyh24
Copy link

skyh24 commented Dec 14, 2018

@skyh24
Copy link

skyh24 commented Dec 14, 2018

it's so wired. i can use flutter create command to generate new project. But i cannot create flutter project in android studio and it stuck

@DoktorDaveJoos
Copy link

This can happen while working behind a corporate proxy.

If you want to create a project with the flutter cli, configure a cntlm - it is necessary that flutter has access/permission to the internet.

If it works on the cli but NOT in android studio or intellij IDEA -> go to file -> settings -> system settings -> HTTP proxy. Configure the proxy manually and !IMPORTANT! check the box "remember" your credentials. After that restart intellij or android studio.

Cheers

@tennessine
Copy link

tennessine commented Jan 24, 2019

Close the http proxy set on android studio solved my problem on mac.
Give myself a thumbup!

@jwren
Copy link
Contributor

jwren commented May 15, 2024

Closing as obsolete as there is no action item here for the Flutter Plugin

@jwren jwren closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests