question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flutter SDK not found exception

See original GitHub issue

When trying to run a Flutter app from IntelliJ, got gradle build exception. Flutter plugin preferences point to /usr/local/google/home/eastrue/flutter for the SDK path. Plugin has not been updated in a while (but no prompt to update).

Console output below:

FAILURE: Build failed with an exception.

* Where:
Build file '/usr/local/google/home/eastrue/IdeaProjects/myfriendlychat/android/app/build.gradle' line: 11

* What went wrong:
A problem occurred evaluating project ':app'.
> Flutter SDK not found. Define location with flutter.sdk in the local.properties file.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error running gradle: Exit code 1 from: /usr/local/google/home/eastrue/android-studio/gradle/gradle-2.14.1/bin/gradle app:properties
FAILURE: Build failed with an exception.

* Where:
Build file '/usr/local/google/home/eastrue/IdeaProjects/myfriendlychat/android/app/build.gradle' line: 11

* What went wrong:
A problem occurred evaluating project ':app'.
> Flutter SDK not found. Define location with flutter.sdk in the local.properties file.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error running gradle: Exit code 1 from: /usr/local/google/home/eastrue/android-studio/gradle/gradle-2.14.1/bin/gradle app:properties

Launching lib/main.dart on Nexus 5X in debug mode...
Built build/app/outputs/apk/app-debug.apk (21.9MB).
Application finished.

Steps to Reproduce

  1. Create new project in IntelliJ IDEA Ultimate (have CE but can’t use it because IntelliJ always starts Ultimate).
  2. Click Run in the toolbar (for the MyApp default app).

Note that MyApp does build and run on the attached Android device.

Version info

[✓] Flutter (on Linux, channel master) • Flutter at /usr/local/google/home/eastrue/flutter • Framework revision c9a9c627b6 (13 days ago), 2017-03-16 18:04:14 • Engine revision 2937f06a15 • Tools Dart version 1.23.0-dev.9.0

[✓] Host Executable Compatibility • Downloaded executables execute on host

[✓] Android toolchain - develop for Android devices (Android SDK 25.0.2) • Android SDK at /usr/local/google/home/eastrue/Android/Sdk • Platform android-25, build-tools 25.0.2 • Java binary at: /usr/local/buildtools/java/jdk/bin/java • Java version: OpenJDK Runtime Environment (build 1.8.0_112-google-v7-150000077-147841663)

[✓] Android Studio (version 2.2) • Android Studio at /opt/android-studio-with-blaze-2.2 • Gradle version 2.14.1

[✓] Android Studio (version 2.2) • Android Studio at /usr/local/google/home/eastrue/android-studio • Gradle version 2.14.1

[✓] IntelliJ IDEA Ultimate Edition (version 2016.2) • Dart plugin version 162.2924 • Flutter plugin version 0.1.11.2

[✓] Connected devices • Nexus 5X • 0048fc9b7c76b7a2 • android-arm • Android 6.0.1 (API 23)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jakobr-googlecommented, Mar 30, 2017

Looks like flutter/flutter#8365. It’s looking for flutter.sdk in android/local.properties, which either doesn’t exist, or has been created by Studio, without flutter.sdk.

Flutter Tools will create local.properties on the first build, but only if it doesn’t exist. If Android Studio beats us to creating it, it won’t have a flutter.sdk entry, and we won’t add one.

Workaround: Delete android/local.properties, and run flutter build apk. You should now be able to build and run from within Studio.

0reactions
LarkAscendingcommented, Apr 12, 2017

This appears to be fixed - Flutter plugin 12.1. Feel free to verify and close. Woo hoo!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flutter SDK is not found in the specified location - in Android ...
Open File · Select settings from the File menu · Select Languages & frameworks from the left panel · Select Flutter · Then...
Read more >
Fix - Flutter SDK not found in the specified location Error
To fix the flutter SDK not found error, please follow the steps below: · Go to Menu > Tools > SDK Manager >...
Read more >
The Flutter SDK is not available - error after pub get in ...
You received this message because you are subscribed to the Google Groups "Flutter Dev" group. To unsubscribe from this group and stop receiving...
Read more >
[2022] 7 Steps to Fix Dart SDK is not Configured in Flutter
To fix the Dart SDK is not Configured error, first of all, you must obtain the Flutter installation path and then figure out...
Read more >
[Solved] Android SDK file not found: adb Error in Flutter
Make sure you have installed "Android SDK Platform-Tools". When you install "Android SDK Platform-Tools", it will fix Android SDK file not found: adb...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found