Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flutter 无法使用 rinf 库,提示 depends on flutter_test from sdk which doesn't exist #3869

Open
dongfengweixiao opened this issue Jun 17, 2024 · 3 comments
Assignees

Comments

@dongfengweixiao
Copy link
Contributor

dongfengweixiao commented Jun 17, 2024

问题类型 / Type of issues

  • 其它 / other

受影响的软件包 / Affected packages

  • flutter

从 flutter.dev 下载 Linux 下的 flutter 安装包,解压后将 flutter/bin 添加到 $PATH 后,创建项目,按 https://rinf.cunarist.com/applying-template/ 添加 rinf 模板,流程可正常执行。

输出如下:

rinf template
Detected `protoc`, skipping auto installation.
Building package executable... 
Built rinf:rinf.
🎉 Rust template is now ready! 🎉

执行 paru -S flutter 从源中安装 flutter 包,共安装以下目标包:

extra/clang                                    17.0.6-2   198.00 MiB
extra/compiler-rt                              17.0.6-2    39.71 MiB
extra/dart                                     3.4.0-1    591.62 MiB
archlinuxcn/flutter-common                     3.22.2-1    23.25 MiB
archlinuxcn/flutter-devel                      3.22.2-1    80.64 MiB
archlinuxcn/flutter-engine-android-google-bin  3.22.2-10  205.39 MiB
archlinuxcn/flutter-engine-common-google-bin   3.22.2-10   21.22 MiB
archlinuxcn/flutter-engine-linux-google-bin    3.22.2-10  204.53 MiB
archlinuxcn/flutter-engine-web-google-bin      3.22.2-10  259.34 MiB
archlinuxcn/flutter-gradle                     3.22.2-1     0.05 MiB
archlinuxcn/flutter-intellij-patch             3.22.2-1     0.00 MiB
archlinuxcn/flutter-material-fonts-google-bin  3.22.2-10    4.80 MiB
archlinuxcn/flutter-sky-engine-google-bin      3.22.2-10    6.90 MiB
archlinuxcn/flutter-target-android             3.22.2-1     0.11 MiB
archlinuxcn/flutter-target-linux               3.22.2-1     0.01 MiB
archlinuxcn/flutter-target-web                 3.22.2-1     0.01 MiB
archlinuxcn/flutter-tool                       3.22.2-1    36.07 MiB
extra/ninja                                    1.12.1-1     0.38 MiB
extra/unzip                                    6.0-21       0.30 MiB
extra/zip                                      3.0-11       0.55 MiB
archlinuxcn/flutter                            3.22.2-1     0.00 MiB

创建项目,按 https://rinf.cunarist.com/applying-template/ 添加 rinf 模板,在执行 rinf template 时,报以下错误:

Detected `protoc`, skipping auto installation.
Resolving dependencies in `/home/AAABBB/source/flutter/rinf_test`... 
Because rinf_test depends on flutter_test from sdk which doesn't exist (the Flutter SDK is not available), version solving
  failed.

Flutter users should use `flutter pub` instead of `dart pub`.
@lilacbot lilacbot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2024
@lilacbot lilacbot reopened this Jun 17, 2024
@nsfoxer
Copy link

nsfoxer commented Jun 22, 2024

nixos上使用pkgs,flutter也遇到这个错误,我怀疑是软件包删除flutter包的.git/导致的,也许吧?

@dongfengweixiao
Copy link
Contributor Author

cunarist/rinf#336 (comment)

需要增加环境变量FLUTTER_ROOT=/usr/lib/flutter

@nsfoxer
Copy link

nsfoxer commented Sep 25, 2024

差不多这样就能执行,但我目前nixos还没怎么学会:
FLUTTER_ROOT=/nix/store/sl7226yszswspdj1d3gz33p97kgi0ldq-flutter-wrapped-3.22.0-sdk-links/ ~/.cargo/bin/rinf template
其中,FLUTTER_ROOT的值为:ls -l $(which @flutter)的链接“根目录”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants