MacOS 10.15 Catalina 的颤振问题
Posted
技术标签:
【中文标题】MacOS 10.15 Catalina 的颤振问题【英文标题】:Flutter Issues with MacOS 10.15 Catalina 【发布时间】:2019-11-24 19:03:53 【问题描述】:更新到MacOS 10.15 Catalina后,Flutter出现问题。
具体来说,Flutter 医生投诉如下:
下载的可执行文件无法在主机上执行。
CocoaPods 未安装。
需要说明的是,在更新之前,当我的电脑运行 Mojave 10.14 时,这些 Flutter 的问题并不存在,因此 flutter doctor -v 没有报告任何问题不管怎样。
关于第一个问题:下载的可执行文件无法在主机上执行。
Flutter 医生提供此链接:https://github.com/flutter/flutter/issues/6207
不过,链接的文章指的是 Linux,而不是 MacOS...
关于第二个问题:CocoaPods 未安装。
Flutter Doctor 建议如下解决方案:
brew install cocoapods
吊舱设置
尽管如此,虽然 "install cocoapods" 工作正常,但 "pod setup" 失败,提示如下错误:
/usr/local/bin/pod: /usr/local/Cellar/cocoapods/1.7.4/libexec/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/pod: line 2: /usr/local/Cellar/cocoapods/1.7.4/libexec/bin/pod: Undefined error: 0
运行 flutter doctor -v 提供以下结果:
[!] Flutter (Channel dev, v1.8.1, on Mac OS X 10.15 19A501i, locale es-PA)
• Flutter version 1.8.1 at /Users/podriasereltuyo/flutter
• Framework revision d3eee57c0b (7 days ago), 2019-07-08 11:04:24 -0700
• Engine revision 3c51a7bfff
• Dart version 2.5.0 (build 2.5.0-dev.0.0 b5aeaa6796)
✗ Downloaded executables cannot execute on host.
See https://github.com/flutter/flutter/issues/6207 for more information
[✓] android toolchain - develop for Android devices (Android SDK version 29.0.1)
MacBook-Air-de-Podria:ptyce podriasereltuyo$ flutter doctor -v
[!] Flutter (Channel dev, v1.8.1, on Mac OS X 10.15 19A501i, locale es-PA)
• Flutter version 1.8.1 at /Users/podriasereltuyo/flutter
• Framework revision d3eee57c0b (7 days ago), 2019-07-08 11:04:24 -0700
• Engine revision 3c51a7bfff
• Dart version 2.5.0 (build 2.5.0-dev.0.0 b5aeaa6796)
✗ Downloaded executables cannot execute on host.
See https://github.com/flutter/flutter/issues/6207 for more information
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at /Users/podriasereltuyo/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[!] Xcode - develop for ios and macOS (Xcode 10.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2.1, Build version 10E1001
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
brew install cocoapods
pod setup
[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 37.0.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.0.0 (API 26) (emulator)
! Doctor found issues in 2 categories.
我很谦虚地希望寻求您的帮助,以澄清下载的可执行文件无法在主机上执行是什么意思?
还有,可以做些什么来解决它? 请?
还有, 如果 cocoapods 在使用 Mojave 10.14 时运行良好,那么现在可能是什么问题,似乎无法成功运行 pod setup?
这里有没有其他人在升级到 MacOs 10.15 Catalina Beta 后遇到Flutter 的任何问题,你以前在 Mojave 上没有遇到过?
谢谢你!!!
更新... 在研究这个问题时,遇到了一个很伤心的评论,表示 Catalina 中基本不支持 Flutter...
请在这里找到它: https://github.com/flutter/flutter/issues/34000
评论说: Flutter 在 macOS 10.15 上尚不支持,尽管我们显然正在研究它。这是 #22598 的副本,它与从 Catalina 中删除 32 位支持有关。
所以,我开始认为回到 Mojave 的安全可能是个好主意,至少 Flutter 工作正常......
请分享您的想法、建议和建议?
【问题讨论】:
【参考方案1】:可以安装 cocoapods,运行 flutter build ios 并在 iOS 模拟器上运行。
brew uninstall cocoapods
sudo gem install -n /usr/local/bin cocoapods
pod install
详细说明在这里:This terminal won't let me run or install cocoa pods because I am on MacOS Catalina Beta?
【讨论】:
非常感谢!!!确实,关于 CocoaPods 的问题确实已经解决了!!! Flutter Doctor 现在说:Xcode - 为 iOS 和 macOS 开发 (Xcode 10.2.1) • Xcode 在 /Applications/Xcode.app/Contents/Developer • Xcode 10.2.1,构建版本 10E1001 • CocoaPods 1.7.4版 然而,另一个问题仍然存在,它说:下载的可执行文件无法在主机上执行。您知道如何解决这个问题吗?谢谢!!! 从 Mojave 升级到 Catalina,这解决了我的颤振构建问题。谢谢【参考方案2】:对于这个问题:
[!] Flutter (Channel dev, v1.7.11, on Mac OS X 10.15 19A487m, locale en-SE) ✗ 下载的可执行文件无法在主机上执行。看 https://github.com/flutter/flutter/issues/6207了解更多信息
简单修复: 在 MAC 上打开终端并运行以下命令:
> flutter channel master
> flutter doctor
享受
【讨论】:
【参考方案3】:卸载并重新安装(如果您使用的是homebrew
,则为fe)。
只要运行:
brew uninstall cocoapods && brew install cocoapods
【讨论】:
以上是关于MacOS 10.15 Catalina 的颤振问题的主要内容,如果未能解决你的问题,请参考以下文章
将 JonesForth 移植到 macOS v10.15 (Catalina)
MacOS Catalina 10.15安装教程,启动U盘制作及安装方法