Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 794 Vote(s) - 3.61 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dart SDK is not configured

#1
I installed Flutter and set up Android Studio. Then I cloned an example of flutter on GitHub (

[To see links please register here]

) and launched it in Android Studio, but it warns me "Dart SDK is not configured", this happened to my co-worker as well. But if I create a new project in Android Studio, no problem at all.

What I have done:

1. Installed Flutter

2. Installed Android Studio, along with Flutter plugin including Dart plugin

3. Flutter run in command line works fine, all five tests passed. (See below)


> [✓] Flutter (on Mac OS X 10.13.3 17D47, locale en-US, channel dev)
> • Flutter version 0.0.22 at /Users/katelyn/flutter
> • Framework revision 3001b3307d (7 days ago), 2018-01-30 11:37:15 -0800
> • Engine revision 8f2d72b183
> • Tools Dart version 2.0.0-dev.16.0
> • Engine Dart version 2.0.0-edge.7af4db0ea091dddca6b2da851e6dda8d7f9467e8
>
> [✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
> • Android SDK at /Users/katelyn/Library/Android/sdk
> • Android NDK location not configured (optional; useful for native profiling support)
> • Platform android-27, build-tools 27.0.3
> • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
> • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
>
> [✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
> • Xcode at /Applications/Xcode.app/Contents/Developer
> • Xcode 9.2, Build version 9C40b
> • ios-deploy 1.9.2
> • CocoaPods version 1.4.0
>
> [✓] Android Studio (version 3.0)
> • Android Studio at /Applications/Android Studio.app/Contents
> • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
>
> [✓] Connected devices
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)

Last week, I can run their example thru command line (in that dir),

flutter run

but now I it shows some errors with Gradle.

> Launching lib/main.dart on Android SDK built for x86 in debug
> mode...
> Initializing gradle... 0.7s
> Resolving dependencies...
> * Error running Gradle:
> Exit code 1 from: /Users/katelyn/AndroidStudioProjects/flutter/examples/flutter_gallery/android/gradlew app:properties:
>
> FAILURE: Build failed with an exception.
>
> * Where:
Build file '/Users/katelyn/AndroidStudioProjects/flutter/examples/flutter_gallery/android/app/build.gradle' line: 20
>
>* What went wrong:
A problem occurred evaluating project ':app'.
> 3
>
> * Try:
> Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
>
> * Get more help at

[To see links please register here]

>
> BUILD FAILED in 0s
>
> Please review your Gradle project setup in the android/ folder.
Reply

#2
I had the same problem after importing a flutter project from git. These are the steps to solve the problem.

1. File->Settings->Language & Framework->Flutter
2. Choose flutter SDK path: the first time we install flutter, we choose the location where the flutter should be installed. Choose this location.
3. Click OK and the android studio will refresh. Carry on if the problem is solved.
4. If you are still stuck with the error.
5. Goto [this](

[To see links please register here]

) link and install Dart.
6. Goto the same place in settings, ..Language & Framework->Dart and chose the SDK location.

This solved the issues for me.
Reply

#3
I am using **Win10 Pro**;

If you are using **Android Studio** and getting this message '`Error: Dart SDK is not found in specified location`',

**My fix was this.**

1. Go to `File/Settings` or `Ctrl+Alt+S` to bring up the settings window.
2. Go down to '`Language & Frameworks` and click on Dart
3. Check `Enable Dart support for the project 'YOUR_PROJECT_NAME'`
4. For the Path `Dart SDK path:` enter the location where you are storing the `flutter` directory.
5. Drill down that directory till you see the Dart SDK directory `C:\flutter\bin\cache\dart-sdk`. You can also `Check SDK update` by checking the box and clicking on `Check now` to get the latest version.

**This worked for me.**
Reply

#4
**In case other answers didn't work for you**

If you are using *nixOS or Mac

1. Open the terminal and type `which flutter`. You'll get something like `/Users/mac/development/flutter/bin/flutter` under that directory go to `cache` folder here you will find either dart-sdk or (and) dart-sdk.old folder. Copy their paths.
2. Open preferences by pressing `ctrl+alt+s` or `cmd+,` on mac. Under
`Language & Frameworks choose Dart` find `Dart SDK path`. Put that
path you've copied at first step to there. Click Apply.

**If this didn't solve the issue you have to also set the Flutter SDK path**

1. Under `Language & Frameworks choose Flutter` and find `Flutter SDK path` field.
2. Your flutter SDK path is two step above in the folder hierarchy relative to which `which flutter` command gave to you. Set it to the field you've found in step 1 of this header. Again click Apply & click save or ok.
Reply

#5
similar to above, I got the dart sdk path from a project I created with flutter(not cloned) by going to Android Studio Preferences | Languages & Frameworks | Dart. Then similarly in the cloned project go to Preferences | Languages & Frameworks | Dart and "Enable Dart support for the project..." and enter the path you saved.
Reply

#6
Flutter is usually installed(per illustrations) in.

C:\src\Flutter

[For Windows Installations...][1]

You can try running `flutter doctor` for installation issues.
Also run `flutter upgrade` to get the latest version of Flutter and Dart SDKs.

DART SDK can be found at

/flutter/bin/cache/dart-sdk


[1]:

[To see links please register here]

Reply

#7
**OS: Ubuntu 19.04**

**IntelliJ: 2019.1.2RC**

I have read on all the previous answer and after some time trying to get this working I found that the IntelliJ Flutter plugin does not want the path to `which flutter` instead it needs the base installation folder.

### So the 2 steps which fixed:

1. Install IntelliJ Flutter plugin:
+ <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>a</kbd> (Open Actions)
+ Type in search 'Flutter' hit enter Install and restart IntelliJ
2. Configure Flutter Plugin:
+ <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>s</kbd> (Open Settings)
+ Type in search 'Flutter', Select option under **Language & Frameworks**
+ Open terminal `which flutter` ***output*** `PATH_TO_FLUTTER/bin/flutter` you **ONLY NEED** the `PATH_TO_FLUTTER` so remove everything from `/bin...`
+ Paste the location on the `Flutter SDK path` input and apply.

That will then ask you to restart IntelliJ and you should get both Flutter and Dart configured:

[![enter image description here][1]][1]

Good luck!


[1]:
Reply

#8
It usually happens with projects that were created in other machines. To fix this on Android Studio 3.1.3:

1. File-> Settings (ctrl+alt+s)
2. Languages and Frameworks -> Dart
3. Check "Enable Dart support for the project..."
4. In "Dart SDK path" click in "..." and navigate to flutter SDK directory. Under that directory you'll find **"bin/cache/dart-sdk"**. This is the dart sdk path you should use.
5. Click "Apply"
6. Close the project and open it again (sometimes you need this step, sometimes doesn't)

**Edit** 2019-05-28 - I don't know how long this option is enabled but I have noticed that in Android Studio 3.4 it's easier to Enable Dart Support in projects that were developed in other machines.

1. File -> Sync Project With Gradle Files
2. After it builds, click in "Enable dart support" in the top of editor panel.
Reply

#9
In fact, it's a good habit to check your settings before you run the app.

1. Have you check the java SDK path ?(in fact, if you have already run another app but failed to run this, which might be download from Github or others.
2. then you might have to check the flutter settings and the dart settings.
Reply

#10
Goto preferences -> Languages & Frameworks -> Flutter

Set your flutter sdk path
for example :-
/Users/apple/flutter-sdk/flutter

then apply your settings.

Make sure all dependencies are installed. if not
run - `flutter pub get ` to install dependencies
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through