The following conditions do not automatically update the value of the flutter.sdk
Flutter plugin version 26.0.1
Dart plugin version 173.4700
@koudle, do you mean automatically update the value of the Flutter SDK from the CLI's perspective, of forthe Flutter IntelliJ plugin? Given the PATH env variable change, you'd likely need to restart IntelliJ for the change to be detected.
@devoncarew Yes.
1、 When I change the PATH env variable ,restart Android Studio and open the existing Flutter project,the value of the Flutter SDK in local.properties is not change.
2、When I delete the local.properties(because the local.properties cannot add to Git),restart Android Studio and open the existing Flutter project,the local.properties cannot regenerated.
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
The build.gradle reads the value of flutter.sdk from the local.properties.
So when I clone the Flutter project from Git,and open it in the Android Studio, the local.properties cannot regenerated,I have to manually add the value of flutter.sdk to local.properties,the value of sdk.dir and ndk.dir also need to add manually.When I open the Android project in the Flutter project,the sdk.dir and ndk.dir can be generated automatically.
I think the way to solve the problem:
1、update the value of the Flutter SDK from the CLI's perspective, of forthe Flutter IntelliJ plugin
2、or read the Flutter SDK path from the System env,not from the local.properties
I have the same issue here, But it seemed that flutter/build.gradle can not read the local.properties!
I do have add flutter.sdk to local.properties. but Ide still complain about not defining it!
Most helpful comment
I have the same issue here, But it seemed that flutter/build.gradle can not read the local.properties!
I do have add flutter.sdk to local.properties. but Ide still complain about not defining it!