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

Build errors on macOS and Linux #22

Open
mz2 opened this issue Jul 24, 2022 · 4 comments
Open

Build errors on macOS and Linux #22

mz2 opened this issue Jul 24, 2022 · 4 comments

Comments

@mz2
Copy link

mz2 commented Jul 24, 2022

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:

  [ +676 ms] ../../../../../../lib/main_window.dart:7:1: Error: 'MenuItem' is imported from both 'package:flutter/src/widgets/platform_menu_bar.dart' and 'package:nativeshell/src/menu.dart'.
  [        ] import 'package:nativeshell/nativeshell.dart';

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:

  [        ] ../../../../../../../flutter/packages/flutter/lib/src/gestures/multidrag.dart:440:5: Error: The 'super-parameters' language feature is disabled for this library.
  [        ] Try removing the package language version or setting the language version to 2.17 or higher.
  [        ]     super.kind,
  [        ]     ^^^^^
@mz2
Copy link
Author

mz2 commented Jul 25, 2022

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

@mz2
Copy link
Author

mz2 commented Jul 25, 2022

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: flutter/engine#34093 ... I'll see if I can make this conditional.

@mz2
Copy link
Author

mz2 commented Jul 25, 2022

(I have posted a PR to resolve the last issue at nativeshell/nativeshell#171 -- will post something for the examples repo as well...)

@pschuegr
Copy link

pschuegr commented Oct 8, 2022

Thanks @mz2 for the build fixes. @knopp will you accept a PR with those changes? I'll file one if so.

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

2 participants