Flutter在MacOS 10.15 Catalina上遇到问题

7
更新到MacOS 10.15 Catalina后,Flutter存在问题。具体来说,Flutter doctor报告以下问题: 下载的可执行文件无法在主机上执行。 CocoaPods未安装。 需要说明的是,在更新之前,当我的电脑运行Mojave 10.14时,这些与Flutter有关的问题并不存在,因此flutter doctor -v报告没有任何问题。
关于第一个问题: 下载的可执行文件无法在主机上执行。 Flutter doctor提供了此链接:https://github.com/flutter/flutter/issues/6207
然而,该链接所涉及的文章指的是Linux,而不是MacOS...
关于第二个问题:CocoaPods未安装。 Flutter doctor建议使用以下解决方案: brew install cocoapods pod setup 然而,尽管“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.

恳请您帮忙解释一下,当显示“下载的可执行文件无法在主机上执行”时,这是什么意思?

还有,如何解决这个问题呢?请您帮帮忙!

此外,如果在使用Mojave 10.14时,Cocoapods正常运行,现在无法成功运行"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工作得很好...

请分享您的想法、建议和意见?

4个回答

12

确实,有关CocoaPods的问题现在已经解决了!!!非常感谢! - Daniel Henry Thomas
Flutter Doctor现在显示:Xcode-开发iOS和macOS(Xcode 10.2.1) • Xcode位于/Applications/Xcode.app/Contents/Developer • Xcode 10.2.1,版本号为10E1001 • CocoaPods版本1.7.4 - Daniel Henry Thomas
然而,另一个问题仍然存在,它说: 下载的可执行文件无法在主机上执行。您有任何想法如何解决这个问题吗?谢谢! - Daniel Henry Thomas
升级到Catalina后,我的Flutter构建问题得到了解决。谢谢。 - Sam Kelham

3
针对这个问题:

[!] Flutter (开发通道,版本 v1.7.11,在 Mac OS X 10.15 19A487m 上,语言环境为 en-SE) ✗ 下载的可执行文件无法在主机上执行。请参见https://github.com/flutter/flutter/issues/6207 获取更多信息。

简易修复方法: 在 MAC 终端上运行以下命令:
> flutter channel master

> flutter doctor

欢迎使用


2

如果您正在使用homebrew,请卸载并重新安装它。

只需运行以下命令:

brew uninstall cocoapods && brew install cocoapods

1
对于以下问题:
[!] Flutter (Channel stable, 3.13.6, on macOS 13.4 22F66 darwin-x64, locale en-GB)
✗ Downloaded executables cannot execute on host.
  See https://github.com/flutter/flutter/issues/6207 for more information.

CocoaPods是一个用于Xcode项目的开源依赖管理器。当你开发iOS移动应用时,你可以使用CocoaPods在一个简单的文本文件中定义所有的依赖,这个文件被称为Podfile。
只需执行以下操作:
brew install cocoapods

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接