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

PathNotFoundException: Cannot open file #2499

Open
988494 opened this issue Jan 15, 2025 · 3 comments
Open

PathNotFoundException: Cannot open file #2499

988494 opened this issue Jan 15, 2025 · 3 comments
Labels
awaiting Waiting for responses, PR, further discussions, upstream release, etc bug Something isn't working

Comments

@988494
Copy link

988494 commented Jan 15, 2025

Describe the bug

Compiling bin/build_tool_runner.dart to kernel file bin/build_tool_runner.dill.
SEVERE: ================================================================================
SEVERE: Cargokit BuildTool failed with error:
SEVERE: --------------------------------------------------------------------------------
SEVERE: PathNotFoundException: Cannot open file, path = 'D:\uim\uim_app\rust_builder\android....\rust\Cargo.toml' (OS Error: 系统找不到指定的路径。
SEVERE: , errno = 3)
SEVERE: --------------------------------------------------------------------------------
SEVERE: #0 _File.throwIfError (dart:io/file_impl.dart:675:7)
SEVERE: #1 _File.openSync (dart:io/file_impl.dart:490:5)
SEVERE: #2 _File.readAsBytesSync (dart:io/file_impl.dart:574:18)
SEVERE: #3 _File.readAsStringSync (dart:io/file_impl.dart:624:18)
SEVERE: #4 CrateInfo.load (package:build_tool/src/cargo.dart:45:35)
SEVERE: #5 BuildEnvironment.fromEnvironment (package:build_tool/src/builder.dart:92:33)
SEVERE: #6 BuildGradle.build (package:build_tool/src/build_gradle.dart:32:42)
SEVERE: #7 BuildGradleCommand.runBuildCommand (package:build_tool/src/build_tool.dart:65:17)
SEVERE: #8 BuildCommand.run (package:build_tool/src/build_tool.dart:37:11)
SEVERE: #9 CommandRunner.runCommand (package:args/command_runner.dart:212:27)
SEVERE: #10 CommandRunner.run. (package:args/command_runner.dart:122:25)
SEVERE: #11 new Future.sync (dart:async/future.dart:313:27)
SEVERE: #12 CommandRunner.run (package:args/command_runner.dart:122:14)
SEVERE: #13 runMain (package:build_tool/src/build_tool.dart:251:18)
SEVERE: #14 runMain (package:build_tool/build_tool.dart:7:21)
SEVERE: #15 main (file:///d:/uim/uim_app/build/rust_lib_uim_app/build/build_tool/bin/build_tool_runner.dart:3:15)
SEVERE: #16 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:295:33)
SEVERE: #17 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
SEVERE: --------------------------------------------------------------------------------
SEVERE: BuildTool arguments: [build-gradle]
SEVERE: ================================================================================

Steps to reproduce

flutter_rust_bridge.yaml内容为:

rust_root: D:\uim\uim-rust\uim-client
rust_input: crate::api
dart_output: lib/src/rust
local: true

How do I set the loaded rust project path instead of the default generated rust project path

Logs

Compiling bin/build_tool_runner.dart to kernel file bin/build_tool_runner.dill.
SEVERE: ================================================================================
SEVERE: Cargokit BuildTool failed with error:
SEVERE: --------------------------------------------------------------------------------
SEVERE: PathNotFoundException: Cannot open file, path = 'D:\uim\uim_app\rust_builder\android\..\..\rust\Cargo.toml' (OS Error: 系统找不到指定的路径。
SEVERE: , errno = 3)
SEVERE: --------------------------------------------------------------------------------
SEVERE: #0      _File.throwIfError (dart:io/file_impl.dart:675:7)
SEVERE: #1      _File.openSync (dart:io/file_impl.dart:490:5)
SEVERE: #2      _File.readAsBytesSync (dart:io/file_impl.dart:574:18)
SEVERE: #3      _File.readAsStringSync (dart:io/file_impl.dart:624:18)
SEVERE: #4      CrateInfo.load (package:build_tool/src/cargo.dart:45:35)
SEVERE: #5      BuildEnvironment.fromEnvironment (package:build_tool/src/builder.dart:92:33)
SEVERE: #6      BuildGradle.build (package:build_tool/src/build_gradle.dart:32:42)
SEVERE: #7      BuildGradleCommand.runBuildCommand (package:build_tool/src/build_tool.dart:65:17)
SEVERE: #8      BuildCommand.run (package:build_tool/src/build_tool.dart:37:11)
SEVERE: #9      CommandRunner.runCommand (package:args/command_runner.dart:212:27)
SEVERE: #10     CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:122:25)
SEVERE: #11     new Future.sync (dart:async/future.dart:313:27)
SEVERE: #12     CommandRunner.run (package:args/command_runner.dart:122:14)
SEVERE: #13     runMain (package:build_tool/src/build_tool.dart:251:18)
SEVERE: #14     runMain (package:build_tool/build_tool.dart:7:21)
SEVERE: #15     main (file:///d:/uim/uim_app/build/rust_lib_uim_app/build/build_tool/bin/build_tool_runner.dart:3:15)
SEVERE: #16     _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:33)
SEVERE: #17     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
SEVERE: --------------------------------------------------------------------------------
SEVERE: BuildTool arguments: [build-gradle]
SEVERE: ================================================================================

Expected behavior

No response

Generated binding code

No response

OS

win11

Version of flutter_rust_bridge_codegen

2.7

Flutter info

C:\Users\yzx>flutter doctor -v
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[√] Flutter (Channel stable, 3.27.1, on Microsoft Windows [版本 10.0.26100.2605], locale zh-CN)
    • Flutter version 3.27.1 on channel stable at D:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 17025dd882 (4 weeks ago), 2024-12-17 03:23:09 +0900
    • Engine revision cb4b5fff73
    • Dart version 3.6.0
    • DevTools version 2.40.2
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[√] Windows Version (Installed version of Windows is version 10 or higher)

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at C:\Users\yzx\AppData\Local\Android\sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: D:\java\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio 生成工具 2022 17.12.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
    • Visual Studio 生成工具 2022 version 17.12.35527.113
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2024.2)
    • Android Studio at D:\java\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)

[√] IntelliJ IDEA Ultimate Edition (version 2024.3)
    • IntelliJ at D:\java\IntelliJ IDEA 2024.3.1
    • Flutter plugin version 83.0.4
    • Dart plugin version 243.23177

[√] Connected device (4 available)
    • 22011211C (mobile) • I7XG59AAQSFE5LFA • android-arm64  • Android 13 (API 33)
    • Windows (desktop)  • windows          • windows-x64    • Microsoft Windows [版本 10.0.26100.2605]
    • Chrome (web)       • chrome           • web-javascript • Google Chrome 131.0.6778.265
    • Edge (web)         • edge             • web-javascript • Microsoft Edge 131.0.2903.146

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

C:\Users\yzx>

Version of clang++

No response

Additional context

No response

@988494 988494 added the bug Something isn't working label Jan 15, 2025
@fzyzcjy fzyzcjy changed the title PathNotFoundException: Cannot open file, path = 'D:\uim\uim_app\rust_builder\android\..\..\rust\Cargo.toml' (OS Error: 系统找不到指定的路径。 PathNotFoundException: Cannot open file Jan 15, 2025
@fzyzcjy
Copy link
Owner

fzyzcjy commented Jan 15, 2025

Hi, does 'D:\uim\uim_app\rust_builder\android\..\..\rust\Cargo.toml' exist?

@fzyzcjy fzyzcjy added the awaiting Waiting for responses, PR, further discussions, upstream release, etc label Jan 15, 2025
@988494
Copy link
Author

988494 commented Jan 16, 2025

I use "flutter_rust_bridge_codegen integrate --rust-crate-dir... /uim-rust/uim-client" Reinitialization is OK; Thank you very much

@fzyzcjy
Copy link
Owner

fzyzcjy commented Jan 16, 2025

You are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting Waiting for responses, PR, further discussions, upstream release, etc bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants