The Flutter SDK is not available - error after pub get in example project

5,289 views
Skip to first unread message

Jon as

unread,
Nov 22, 2016, 4:20:23 AM11/22/16
to Flutter Dev
Hello,
I always get the following error, when I try tu run pub get (from IntelliJ or the terminal) in one of the example projects (tested with hello_world, hello_service, Gallery):

$ pub get

Resolving dependencies... 

The Flutter SDK is not available.

Depended on by:

- hello_world 


Additional Informations:  

$ flutter doctor

[✓] Flutter (on Mac OS, channel master)

    • Flutter at /Users/jonas/Library/flutter

    • Framework revision a0c567f751 (5 hours ago), 2016-11-21 20:17:41

    • Engine revision cea5ed2b9b

    • Tools Dart version 1.21.0-dev.6.0


[✓] Android toolchain - develop for Android devices (Android SDK 25.0.0)

    • Android SDK at /Users/jonas/Library/Android/sdk

    • Platform android-25, build-tools 25.0.0

    • Java(TM) SE Runtime Environment (build 1.8.0_111-b14)


[✓] iOS toolchain - develop for iOS devices (Xcode 8.1)

    • XCode at /Applications/Xcode.app/Contents/Developer

    • Xcode 8.1, Build version 8B62


[✓] IntelliJ IDEA Community Edition (version 2016.2.5)

    • Dart plugin installed

    • Flutter plugin installed


[✓] Connected devices

    • SM N9005 • eb53b4f0 • android-arm • Android 5.0 (API 21)

I also create the android/local.properties and ios/Flutter/Generated.xcconfig configuration files, as documented in the readme. 

When I create a new Flutter project in IntelliJ, I don't get any errors. So my workaround was, migrating the Code from example to the new project. 

It seems, that there is somewhere in the configuration of the example projects a wrong path to the flutter sdk. Is it only an error in my environment or does anybody had the same issue?

Thanks!

Jonas


Alexandre Ardhuin

unread,
Nov 22, 2016, 4:27:30 AM11/22/16
to Jon as, Flutter Dev
You should use `flutter packages get` instead of `pub get`.

Cheers
Alexandre

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexandre Ardhuin

unread,
Nov 22, 2016, 4:29:32 AM11/22/16
to Jon as, Flutter Dev

Jon as

unread,
Nov 22, 2016, 4:44:27 AM11/22/16
to Flutter Dev
Hello Alexandre,

You should use `flutter packages get` instead of `pub get`.

I already did the flutter packages get,  but after that I still hat problems to run the project from IntelliJ. I run pub get, because IntelliJ did it over the pub action get dependencies. But now it is more clear where the problem is. IntelliJ opens the example project as a pure dart project. It should be opened as a flutter project. 

Michael Thomsen

unread,
Nov 22, 2016, 5:07:28 AM11/22/16
to Jon as, Flutter Dev
Do you have the Flutter IntelliJ plugin (see Flutter getting started) installed?

--

Jon as

unread,
Nov 22, 2016, 5:34:54 AM11/22/16
to Flutter Dev

Do you have the Flutter IntelliJ plugin (see Flutter getting started) installed?

Of course I have installed the Flutter plugin. I alreade worked with flutter and as I wrote, i get no errors, wehen I create a new project. 

Anyway, I found a solution. I compared the hello_world example with a new flutter project, createt with IntelliJ. The new project worked without problems.

1. There is an error in Modul Properties of the example project ( context menu on the root node of the project tree -> Open Module Setting or F4 in my configuration): 


When I click on the hello_world link, I see the Project Settings -> Project - Entry. But the settings doesn't differ from the Settings in the working project. 

2. I compared the files of the two projects. I discover, that there is no flutter.yaml File in the hello_world example. So I created one with the following content: 

name: hello_world
uses-material-design: true
 
I restart the IntelliJ IDE and got the following message: 



After clicking on Change module type to Flutter and reload project The example project works. 

Is there an easier way to change the module type of the project? I did't found something.

It could be possible, that the problem depends on the fact, that I have installed WebStorm with dart for web development, before I installed IntelliJ with Flutter support. Maybe there is some side effect.







Michael Thomsen

unread,
Nov 22, 2016, 6:10:18 AM11/22/16
to Jon as, Flutter Dev
Sorry, I was posting my phone, so did not read your message (and doctor output) correctly.

Having WebStorm installed is fine, and should not cause any issues.

But it looks like I can repro this. I think it's a regression. Do you mind logging a bug here?

Jon as

unread,
Nov 22, 2016, 7:05:55 AM11/22/16
to Flutter Dev
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages