The error message “flutter unable to find a target named ‘runnertests’ in project ‘runner.xcodeproj’, did find ‘runner'” occurs when Flutter is unable to locate a target named ‘runnertests’ in the Xcode project file ‘runner.xcodeproj’.
The ‘flutter run’ command is used to run the Flutter application on a specified target. By default, the target is the one named ‘runner’ in the Xcode project file. However, in this case, it seems that the target ‘runnertests’ is being specified, which is not present in the project file.
To fix this issue, you should verify the name of the target in the Xcode project file and make sure it matches the target being specified in the Flutter command. Here’s an example of how to run the Flutter application using the correct target:
$ flutter run -t lib/main.dart --target-platform=ios --target=runner
In the above example, we are running the Flutter application using the target ‘runner’, which is the default target in the Xcode project file. Make sure to replace ‘lib/main.dart’ with the path to your main.dart file.
If the target you want to run is actually named ‘runnertests’ and it is not present in the Xcode project file, you will need to add it to the project file before running the Flutter application with that target.
Read more interesting post
- Importerror: cannot load backend ‘tkagg’ which requires the ‘tk’ interactive framework, as ‘headless’ is currently running
- Failed to execute commandlinerunner
- Clientbuilder.sslsocketfactory(sslsocketfactory) not supported on jdk 9+
- Command phasescriptexecution failed with a nonzero exit code fbreactnativespec
- Flutter keyboard closes immediately