問題描述
為什麼我可以通過 android 模擬器運行一個簡單的計數器應用程序,但不能通過 ios 模擬器運行? (Why can I run a simple counter application through an android simulator but not through an ios simulator?)
我正在嘗試運行一個在 android 模擬器和 ios 模擬器上創建計數器的示例應用程序。android模擬器是通過android studio創建的,ios模擬器是通過xcode創建的。該應用程序在 android 模擬器上運行良好,但在執行相同步驟時在 ios 模擬器上運行良好。關於如何解決這個問題的任何想法?
這就是返回:
Launching lib/main.dart on iPhone 11 in debug mode...
Running Xcode build...
Xcode build done. 10.8s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode 的輸出:
↳
ld: framework not found Flutter
clang: error: linker command failed with exit code 1 (use ‑v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
Could not build the application for the simulator.
Error launching application on iPhone 11.
參考解法
方法 1:
Type in your shell open ios/Runner.xcodeproj
the on XCode go to Runner ‑> Targets Runner ‑> All And check you have a Team selected and also if it's a physical device you granted the permission on the iPhone.
Steps: https://i.stack.imgur.com/Qeh7p.png
(by jasltng、Santiago M)