簡體   English   中英

無法在模擬器中運行 flutter 應用程序 (iOS 15)

[英]Not able to run flutter application in simulator (iOS 15)

我已將 flutter 版本從 1.x 更新到 2.8.x,現在我正在嘗試在 Xcode 13.1 和模擬器 iOS 15 中運行應用程序。我正面臨此錯誤。 'mobileffmpeg/LogDelegate.h' file not found並且Command CompileSwiftSources failed with a nonzero exit code我嘗試了一些可用的解決方案,但它對我不起作用。

我正在使用最新的 cocoa pod 版本1.11.3

錯誤日志(在 iOS 中執行 flutter clean 和 flutter pub get 和 pod install 之后)

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.

當您升級 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 pubspec.lock檢查你的xyz版本,然后將更多 package xyz添加到具有兼容版本的 pubspec.yaml 中。

更新:您似乎對 package https://pub.dev/packages/flutter_ffmpeg有疑問,請查看 label 部分的自述文件:

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)

而且,因為package停產了。 您應該更改為https://pub.dev/packages/ffmpeg_kit_flutter

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM