Open mz2 opened 1 year ago
I was able to build the examples with the following tweaks:
in pubspec.yaml:
environment:
- sdk: ">=2.12.0-214.0.dev <3.0.0"
+ sdk: ">=2.17.0 <3.0.0"
in lib/main_window.dart
and lib/pages/menu.dart
:
-import 'package:nativeshell/nativeshell.dart';
+import 'package:nativeshell/nativeshell.dart' as nativeshell;
(+ a whole bunch of prexing individual nativeshell type references in both source code files with nativeshell.
)
in Cargo.toml
(this was needed at least on macOS with arm64 given the Flutter framework's universal binary containing the arm64 binary in the x64 folder, which is fixed in nativeshell_build on the main branch):
-nativeshell_build = { version = "0.1.13" }
+nativeshell_build = { git = "https://github.com/nativeshell/nativeshell.git" }
[dependencies]
-nativeshell = { version = "0.1.13" }
+nativeshell = { git = "https://github.com/nativeshell/nativeshell.git" }
However, cargo run
fails with the following:
thread 'main' panicked at 'Failed to add method acceptsFirstMouse:', /Users/mz2/.cargo/registry/src/github.com-1ecc6299db9ec823/objc-0.2.7/src/declare.rs:180:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Ah, the last problem I have I think is because I tried running with the beta version of the SDK, and they recently added this to Flutter engine itself: https://github.com/flutter/engine/pull/34093 ... I'll see if I can make this conditional.
(I have posted a PR to resolve the last issue at https://github.com/nativeshell/nativeshell/pull/171 -- will post something for the examples repo as well...)
Thanks @mz2 for the build fixes. @knopp will you accept a PR with those changes? I'll file one if so.
I am experiencing build errors when trying to build the example code of the following kind (loads more of these in the
cargo build
output:This is after I edited
pubspec.yaml
to set the SDK version to 2.17.0 or newer, since without doing that there were loads of these errors: