cunarist / rinf

Rust for native business logic, Flutter for flexible and beautiful GUI
MIT License
1.99k stars 72 forks source link

Error when compiling '.proto' files #130

Closed hareendranmg closed 1 year ago

hareendranmg commented 1 year ago

Hi,

When i run the cargo check command, following error occurs.

PS C:\Users\haree\flutter_dev\serial_testing_01> cargo check
   Compiling hub v0.1.0 (C:\Users\haree\flutter_dev\serial_testing_01\native\hub)
error: failed to run custom build command for `hub v0.1.0 (C:\Users\haree\flutter_dev\serial_testing_01\native\hub)`

Caused by:
  process didn't exit successfully: `C:\Users\haree\flutter_dev\serial_testing_01\target\debug\build\hub-fc2cce80ab81229d\build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-changed=C:\Users\haree\flutter_dev\serial_testing_01\messages
  cargo:rerun-if-changed=C:\Users\haree\flutter_dev\serial_testing_01\messages\interaction.proto
  cargo:rerun-if-changed=C:\Users\haree\flutter_dev\serial_testing_01\messages\sample_schemas.proto
  cargo:rerun-if-changed=interaction.proto
  cargo:rerun-if-changed=sample_schemas.proto
  cargo:rerun-if-changed=C:\Users\haree\flutter_dev\serial_testing_01\messages

  --- stderr
  thread 'main' panicked at 'Could not compile `.proto` files into Rust: Custom { kind: PermissionDenied, error: "failed to invoke protoc (hint: https://docs.rs/prost-build/#sourcing-protoc): (path: \"C:\\\\Users\\\\haree\\\\protoc-24.2-win64\\\\bin\"): Access is denied. (os error 5)" }', native\hub\build.rs:52:12
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
PS C:\Users\haree\flutter_dev\serial_testing_01>

flutter doctor

PS C:\Users\haree\flutter_dev\serial_testing_01> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.2, on Microsoft Windows [Version 10.0.22621.2134], locale en-IN)
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Chrome - develop for the web
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.5.3)
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.81.1)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!
PS C:\Users\haree\flutter_dev\serial_testing_01>

rustc --version

PS C:\Users\haree\flutter_dev\serial_testing_01> rustc --version
rustc 1.72.0 (5680fa18f 2023-08-23)
PS C:\Users\haree\flutter_dev\serial_testing_01>

protoc --version

PS C:\Users\haree\flutter_dev\serial_testing_01> protoc --version
libprotoc 24.2
PS C:\Users\haree\flutter_dev\serial_testing_01>
temeddix commented 1 year ago

Hello @hareendranmg :)

Could you try updating RIF to 3.2.1 and run dart run rust_in_flutter message in the terminal? The way of building .proto files has changed a little.

hareendranmg commented 1 year ago

Hi @temeddix, it's working with 3.2.1.

temeddix commented 1 year ago

Thanks for letting us know!