-
Notifications
You must be signed in to change notification settings - Fork 1
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 run -d macos 可以运行,但是 flutter build macos 失败 #1
Comments
机器是 Macbook M1 |
我模糊的记得好像曾经自己也遇到过这个问题,但是我忘了怎么解决了,似乎是rust版本问题。看看的你现在电脑上的rust版本呢。 |
看看的rust和我一样不,不一定的花把多余的删除了,版本不同的升级到至少和我一样的版本 执行 rustup show Default host: aarch64-apple-darwin
rustup home: /Users/develop/.rustup
installed targets for active toolchain
--------------------------------------
aarch64-apple-darwin
aarch64-apple-ios
x86_64-apple-darwin
x86_64-apple-ios
active toolchain
----------------
stable-aarch64-apple-darwin (default)
rustc 1.70.0 (90c541806 2023-05-31) |
出现了新的问题 Launching lib/main.dart on macOS in debug mode...
Running pod install...
Building macOS application...
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-000805921EC3401E }
{ platform:macOS, arch:x86_64, id:00006000-000805921EC3401E }
/Users/lake/Projects/fterm/macos/Runner.xcodeproj: error: No profiles for 'com.github.springeye.fterm' were found: Xcode couldn't find any Mac App Development provisioning profiles matching 'com.github.springeye.fterm'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'Runner' from project 'Runner')
/Users/lake/Projects/fterm/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.11, but the range of supported deployment target versions is 10.13 to 13.1.99. (in target 'FMDB' from project 'Pods')
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Flutter Assemble' from project 'Runner')
** BUILD FAILED **
Exception: Build process failed 之前没接触过 mac 的开发,感觉应该是某个地方没配对,但是搜了好久没解决。 |
|
目前情况是这样的 lake@LakedeMacBook-Pro ~ % rustup show
Default host: aarch64-apple-darwin
rustup home: /Users/lake/.rustup
installed targets for active toolchain
--------------------------------------
aarch64-apple-darwin
x86_64-apple-darwin
active toolchain
----------------
stable-aarch64-apple-darwin (default)
rustc 1.70.0 (90c541806 2023-05-31) 编译 lake@LakedeMacBook-Pro fterm % flutter build macos
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-000805921EC3401E }
{ platform:macOS, arch:x86_64, id:00006000-000805921EC3401E }
+ cargo build --manifest-path=/Users/lake/Projects/fterm/rust_ffi/Cargo.toml --features= --lib --release --target=x86_64-apple-darwin
Compiling cfg-if v1.0.0
Compiling core-foundation-sys v0.8.4
Compiling pin-project-lite v0.2.9
Compiling bytes v1.4.0
Compiling libc v0.2.146
Compiling futures-core v0.3.28
Compiling once_cell v1.18.0
Compiling itoa v1.0.6
error[E0463]: can't find crate for `core`
|
= help: consider downloading the target with `rustup target add x86_64-apple-darwin`
error[E0463]: can't find crate for `compiler_builtins`
......
error[E0425]: cannot find function, tuple struct or tuple variant `Ok` in this scope
--> /Users/lake/.cargo/registry/src/index.crates.io-6f17d22bba15001f/once_cell-1.18.0/src/race.rs:405:13
|
405 | Ok(unsafe { &*ptr })
| ^^ not found in this scope
Some errors have detailed explanations: E0405, E0408, E0412, E0425, E0432, E0463, E0531.
error: could not compile `once_cell` (lib) due to 241 previous errors
/Users/lake/Projects/fterm/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.11, but the range of supported deployment target versions is 10.13 to 13.1.99. (in target 'FMDB' from project 'Pods')
** BUILD FAILED **
Building macOS application...
Build process failed
|
能debug运行的话是不是说明编译环境没问题 |
首先我不太确定我记忆中的内容是否是对的,我记得当时我google上搜索出来最后处理到问题,原因是因为release模式的时候rust和debug一些什么是不同的,我好像是执行个rust的相关的各种更新(确保更新成功了)再把多余的东西都清除掉就好了 |
在 arm 架构的机器编译,为什么它的参数是 |
具体的我不没研究过,用的是这个cargo-xcodebuild这个项目。你可以参考一下。不过我觉得可能是因为flutter默认编译出来的是通用二进制,但是rust不能编译像mac下的通用的动态链接库(混合了x86和arm64架构,),所以他只能单独编译x86和arm64,然后用lipo把他们合并到了 |
好的感谢 |
flutter run -d macos 可以运行
flutter build macos 失败
flutter 信息
The text was updated successfully, but these errors were encountered: