Flutter Unable to find a target named RunnerTests in project Runner.xcodeproj, did find Runner.


支持注册ChatGPT Plus的OneKey虚拟卡
绑定Apple Pay、Google Pay、支付宝和微信支付进行日常消费

注册和了解更多 ->


This error occurs when running tests in a Flutter project with Xcode. The solution is to add a new target called "RunnerTests" to the Xcode project. To do this, follow these steps:

  1. Open the Runner.xcodeproj in Xcode.
  2. Click on the "Runner" project in the left sidebar.
  3. Go to File > New > Target.
  4. Select "iOS Unit Testing Bundle" under the "Test" category and click Next.
  5. Name the target "RunnerTests" and click Finish.
  6. In the "General" tab of the "RunnerTests" target settings, change the "Host Application" to "Runner".
  7. Run the tests again and the error should be resolved.