flutter 无法在模拟器中运行扑动应用程序(iOS 15)

jc3wubiy  于 2022-11-30  发布在  Flutter
关注(0)|答案(1)|浏览(224)

我已经将flutter版本从1.x更新到2.8.x,现在我正尝试在Xcode 13.1和模拟器iOS 15中运行应用程序。我面临着这个错误。'mobileffmpeg/LogDelegate.h' file not foundCommand CompileSwiftSources failed with a nonzero exit code我尝试了一些可用的解决方案,但它不适合我。
我正在使用最新的cocoa pod版本1.11.3
错误日志(在iOS中执行flutter清理、flutter发布获取和pod安装后)

Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    /Users/username/Library/Developer/Xcode/DerivedData/Runner-ewlkrnytkuoiywhfslyuauileapw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/mobile-ffmpeg-https.build/Script-4C68ADEB2D24F6C2D2249598537085F9.sh: 
line 2: /Users/username/Documents/spieler_coach part 2/ios/Pods/Target Support Files/mobile-ffmpeg-https/mobile-ffmpeg-https-xcframeworks.sh: Permission denied
    Command PhaseScriptExecution failed with a nonzero exit code
    error: the following command failed with exit code 0 but produced no further output
CompileC /Users/username/Library/Developer/Xcode/DerivedData/Runner-ewlkrnytkuoiywhfslyuauileapw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/webview_flutter_wkwebview.build/Objects-normal/arm64/FlutterWebView.o /Users/username/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FlutterWebView.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'webview_flutter_wkwebview' from project 'Pods')
    note: Building targets in dependency order
    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 'Runner' from project 'Runner')
    warning: Run script build phase 'Thin Binary' 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 'Runner' from project 'Runner')
Could not build the application for the simulator.
q8l4jmvw

q8l4jmvw1#

当你升级flutter版本时,有些库就不能用了。你知道^的意思吗?例如:您使用的是5.10版本的lib abc,如abc: ^5.1.0,abc还有其他版本5.2.0,... 5.9.06.0.0。如果您使用^,则意味着版本范围从5.1.0 to 5.9.0开始。可能在5.9.0版本中存在问题。此外,有时候原因不是你的库而是它的依赖性。abc库使用xyz内部然后它使用更高的版本与你的flutter版本冲突。

  • 所以这里的解决方案是:
  • 尝试修复所有库的硬版本,使用^删除:abc: 5.1.0
  • 如果问题来自于你的库的依赖性,比如xyz。检查你的xyz版本是否来自pubspec.lock,然后将更多的xyz包添加到pubspec.yaml中。
    **更新:**您可能遇到软件包https://pub.dev/packages/flutter_ffmpeg得问题,请查看Readme中得部分标签:
2.1.2 iOS (Flutter >= 2.x) then replace two lines below:

def flutter_install_ios_plugin_pods(ios_application_path = nil)
↓
def flutter_install_plugin_pods(application_path = nil, relative_symlink_dir, platform)

plugin_pods = flutter_parse_plugins_file(plugins_file)
↓
plugin_pods = flutter_parse_plugins_file(plugins_file, platform)

而且,因为包已经停产了,你应该改成https://pub.dev/packages/ffmpeg_kit_flutter

相关问题