flutter-rs / flutter-rs

Build beautiful desktop apps with flutter and rust. 🌠 (wip)
MIT License
2.1k stars 77 forks source link

Error: Couldn't find flutter sdk #140

Open LIPUU opened 4 years ago

LIPUU commented 4 years ago

I followed the correct steps, but when I run "cargo flutter run " I got a "error: couldn't find shuttle SDK"

csnewman commented 4 years ago

Could you provide the steps you performed?

sanket143 commented 4 years ago
$ git clone https://github.com/flutter-rs/flutter-app-template
$ cd flutter-app-template/
$ cargo install cargo-flutter
$ cargo flutter run
Error: Couldn't find flutter sdk

My futter is in ~/Programs/flutter and has been added to the PATH variable. Does cargo flutter run looks for some env varialbe like FLUTTER_HOME or something for sdk?

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Android Studio (version 3.5)
[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.
sanket143 commented 4 years ago

Okay, I found out that flutter-rs/cargo-flutter checks for FLUTTER_ROOT. There is also an else clause which uses which('flutter') but that somehow didn't work.

export FLUTTER_ROOT=/path/to/flutter/bin will do.

https://github.com/flutter-rs/cargo-flutter/blob/master/src/flutter.rs#L13