找不到框架“Pods_Runner”

Yar*_*rak 6 xcode ios cocoapods flutter

我正在尝试运行 flutter 应用程序,但收到此错误

\n

这里有同样的问题,但没有帮助

\n
Launching lib/main_dev.dart on iPhone 15 in debug mode...\nmain_dev.dart:1\nUpgrading Pods-Runner-frameworks.sh\nXcode build done.                                           54.7s\nFailed to build iOS app\nError (Xcode): Framework \'Pods_Runner\' not found\n\nError (Xcode): Linker command failed with exit code 1 (use -v to see invocation)\n\n
Run Code Online (Sandbox Code Playgroud)\n

版本

\n
[\xe2\x9c\x93] Flutter (Channel stable, 3.10.5, on macOS 14.0 23A344 darwin-arm64, locale en-TR)\n    \xe2\x80\xa2 Flutter version 3.10.5 on channel stable at /Users/yarenalbayrak/Developer/flutter\n    \xe2\x80\xa2 Upstream repository https://github.com/flutter/flutter.git\n    \xe2\x80\xa2 Framework revision 796c8ef792 (4 months ago), 2023-06-13 15:51:02 -0700\n    \xe2\x80\xa2 Engine revision 45f6e00911\n    \xe2\x80\xa2 Dart version 3.0.5\n    \xe2\x80\xa2 DevTools version 2.23.1\n[\xe2\x9c\x93] Xcode - develop for iOS and macOS (Xcode 15.0)\n    \xe2\x80\xa2 Xcode at /Applications/Xcode.app/Contents/Developer\n    \xe2\x80\xa2 Build 15A240d\n    \xe2\x80\xa2 CocoaPods version 1.11.3\n\n
Run Code Online (Sandbox Code Playgroud)\n

它每次运行都会创建 pods_runner 文件\n它每次运行都会创建 pods_runner 文件。

\n

我的 Podfile 部分如下所示。当我删除 use_frameworks! 当运行时不创建文件的行我遇到了一些其他问题。

\n
# Uncomment this line to define a global platform for your project\nplatform :ios, \'14.0\'\n\ntarget \'Runner\' do\n  use_frameworks!\n  use_modular_headers!\n\n flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))\nend\n\npost_install do |installer|\n  installer.pods_project.targets.each do |target|\n    flutter_additional_ios_build_settings(target)\n    target.build_configurations.each do |config|\n     config.build_settings[\'IPHONEOS_DEPLOYMENT_TARGET\'] = \'14\'\n    end\n  end\nend\n
Run Code Online (Sandbox Code Playgroud)\n

小智 12

  1. 删除Podfile
  2. run flutter cleanflutter pub get在你的 Flutter 程序中,然后Podfile会生成
  3. 在 new 中Podfile,调整platform为 14.0 并取消注释该行
  4. pod install在你的iOS程序中运行

一切都会变好


Yar*_*rak 1

我通过这种方法解决了这个问题,当我运行 pod install 时,它给了我警告

Runner [Debug-dev]目标覆盖EXCLUDED_ARCHS[sdk=iphonesimulator*]

我转到 Target -> Build Settings 并搜索 EXCLUDED_ARCHS 并将值更改为 $(inherited)