Flutter应用程序不在MacOS上工作 - >异常:启动MacOS应用程序时运行POD安装的错误。在MacOS外面运行时没有错误
尝试在MacOS上启动时,我会收到此错误消息。
使用iOS模拟器,Android模拟器或Chrome Web应用程序启动时,我没有任何问题。
我在M1 Mac上工作,我的终端通过Rosetta推出。
我已经手动卸下并重新安装了flutter应用程序中iOS文件夹中的吊舱。
请帮忙。以下是试图运行应用程序的VSCODE中的调试控制台以及Flutter Doctor -v的结果。
Launching lib/main.dart on macOS in debug mode...
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Fetching external sources
-> Fetching podspec for `FlutterMacOS` from `Flutter/ephemeral`
-> Fetching podspec for `audio_session` from `Flutter/ephemeral/.symlinks/plugins/audio_session/macos`
-> Fetching podspec for `audioplayers` from `Flutter/ephemeral/.symlinks/plugins/audioplayers/macos`
-> Fetching podspec for `device_info_plus_macos` from `Flutter/ephemeral/.symlinks/plugins/device_info_plus_macos/macos`
-> Fetching podspec for `flutter_secure_storage_macos` from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`
-> Fetching podspec for `just_audio` from `Flutter/ephemeral/.symlinks/plugins/just_audio/macos`
-> Fetching podspec for `package_info_plus_macos` from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`
-> Fetching podspec for `path_provider_macos` from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`
-> Fetching podspec for `pdfx` from `Flutter/ephemeral/.symlinks/plugins/pdfx/macos`
-> Fetching podspec for `printing` from `Flutter/ephemeral/.symlinks/plugins/printing/macos`
-> Fetching podspec for `shared_preferences_macos` from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`
-> Fetching podspec for `sqflite` from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`
-> Fetching podspec for `url_launcher_macos` from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`
-> Fetching podspec for `wakelock_macos` from `Flutter/ephemeral/.symlinks/plugins/wakelock_macos/macos`
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
[!] CocoaPods could not find compatible versions for pod "just_audio":
In Podfile:
just_audio (from `Flutter/ephemeral/.symlinks/plugins/just_audio/macos`)
Specs satisfying the `just_audio (from `Flutter/ephemeral/.symlinks/plugins/just_audio/macos`)` dependency were found, but they required a higher minimum deployment target.
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in `raise_error_unless_state'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict'
<internal:kernel>:90:in `tap'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:682:in `attempt_to_activate'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:94:in `resolve'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1078:in `block in resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `load'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `<main>'
Exception: Error running pod install
Exited
flutter医生-v下面:
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.4 21F79 darwin-arm (Rosetta),
locale en-US)
• Flutter version 3.0.2 at /Users/jackestes/Flutter/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cd41fdd495 (7 days ago), 2022-06-08 09:52:13 -0700
• Engine revision f15f824b57
• Dart version 2.17.3
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version
32.1.0-rc1)
• Android SDK at /Users/jackestes/Library/Android/sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at:
/opt/homebrew/Cellar/openjdk/18.0.1.1/libexec/openjdk.jdk/Contents/Home/bi
n/java
• Java version OpenJDK Runtime Environment Homebrew (build 18.0.1.1+0)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
• Xcode at /Applications/Coding/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Coding/Android Studio.app/Contents
• Flutter plugin can be installed from:
I get this error message when trying to launch on macOS.
I have no issues when launching with iOS simulator, android emulator, or chrome web app.
I work on an M1 Mac and my terminal launches through rosetta.
I have manually removed and reinstalled the pods in the iOS folder within the flutter app.
Please help. Below is the debug console within VSCode when trying to run the app as well as the results from flutter doctor -v.
Launching lib/main.dart on macOS in debug mode...
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Fetching external sources
-> Fetching podspec for `FlutterMacOS` from `Flutter/ephemeral`
-> Fetching podspec for `audio_session` from `Flutter/ephemeral/.symlinks/plugins/audio_session/macos`
-> Fetching podspec for `audioplayers` from `Flutter/ephemeral/.symlinks/plugins/audioplayers/macos`
-> Fetching podspec for `device_info_plus_macos` from `Flutter/ephemeral/.symlinks/plugins/device_info_plus_macos/macos`
-> Fetching podspec for `flutter_secure_storage_macos` from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`
-> Fetching podspec for `just_audio` from `Flutter/ephemeral/.symlinks/plugins/just_audio/macos`
-> Fetching podspec for `package_info_plus_macos` from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`
-> Fetching podspec for `path_provider_macos` from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`
-> Fetching podspec for `pdfx` from `Flutter/ephemeral/.symlinks/plugins/pdfx/macos`
-> Fetching podspec for `printing` from `Flutter/ephemeral/.symlinks/plugins/printing/macos`
-> Fetching podspec for `shared_preferences_macos` from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`
-> Fetching podspec for `sqflite` from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`
-> Fetching podspec for `url_launcher_macos` from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`
-> Fetching podspec for `wakelock_macos` from `Flutter/ephemeral/.symlinks/plugins/wakelock_macos/macos`
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
[!] CocoaPods could not find compatible versions for pod "just_audio":
In Podfile:
just_audio (from `Flutter/ephemeral/.symlinks/plugins/just_audio/macos`)
Specs satisfying the `just_audio (from `Flutter/ephemeral/.symlinks/plugins/just_audio/macos`)` dependency were found, but they required a higher minimum deployment target.
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in `raise_error_unless_state'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict'
<internal:kernel>:90:in `tap'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:682:in `attempt_to_activate'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:94:in `resolve'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1078:in `block in resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `load'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `<main>'
Exception: Error running pod install
Exited
Flutter Doctor -v below:
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.4 21F79 darwin-arm (Rosetta),
locale en-US)
• Flutter version 3.0.2 at /Users/jackestes/Flutter/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cd41fdd495 (7 days ago), 2022-06-08 09:52:13 -0700
• Engine revision f15f824b57
• Dart version 2.17.3
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version
32.1.0-rc1)
• Android SDK at /Users/jackestes/Library/Android/sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at:
/opt/homebrew/Cellar/openjdk/18.0.1.1/libexec/openjdk.jdk/Contents/Home/bi
n/java
• Java version OpenJDK Runtime Environment Homebrew (build 18.0.1.1+0)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
• Xcode at /Applications/Coding/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Coding/Android Studio.app/Contents
• Flutter plugin can be installed from:
???? https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
???? https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build
11.0.12+0-b1504.28-7817840)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.1.1)
• IntelliJ at /Applications/Coding/IntelliJ IDEA.app
• Flutter plugin can be installed from:
???? https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
???? https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.68.1)
• VS Code at /Applications/Coding/Visual Studio Code.app/Contents
• Flutter extension version 3.42.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.4 21F79 darwin-arm
(Rosetta)
• Chrome (web) • chrome • web-javascript • Google Chrome 102.0.5005.115
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在Podfile Uncomment Platform版本中,将其值更改为11或12
In PodFile uncomment platform version and change its value to 11 or 12
您将什么设置为MacOS的部署目标?

如下所示,您需要增加Podfile内部的版本。
What do you have set as the deployment target for macOS?

You need to increase the version inside Podfile as shown below.
删除podfile.lock,
并运行POD安装
Delete Podfile.lock,
and run pod install