[!] unable to find a target named `runnertests` in project `runner.xcodeproj`, did find `runner`.

Explanation:

When encountering the error “unable to find a target named ‘runnertests’ in project ‘runner.xcodeproj’, did find ‘runner'”, it means that there is an issue with the specified target in the given Xcode project.

In Xcode, a target refers to a specific application or framework within a project. Targets can have different configurations and build settings, allowing you to create multiple variations of your project.

In this specific case, the error message indicates that the target ‘runnertests’ could not be found in the project ‘runner.xcodeproj’, but a target named ‘runner’ was found.

To resolve this issue, you may consider the following steps:

  1. Verify the target name: Double-check the target name specified in your Xcode project settings. Ensure that it is spelled correctly and matches the target you want to build.
  2. Check the project configuration: Make sure that the specified target is included in the project configuration. Navigate to the project settings in Xcode and ensure that the ‘runnertests’ target is added and properly configured.
  3. Check for rename or deletion: If the error persists, verify if the ‘runnertests’ target has been renamed or deleted. This can often occur if the project has undergone changes or if the target was manually modified outside of Xcode.

Example:

        
$ flutter run -t test/runnerTests.dart
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running pod install...
CocoaPods' output:
  Preparing
  Resolving dependencies of `Podfile`
  Pod installation complete! There are 17 dependencies from the Podfile and 49 total pods installed.
  Creating shallow clone of spec repo `flutter`
  Cloning spec repo `flutter` from `https://github.com/flutter/flutter.git`
  $ /usr/bin/git init /Users/exampleUser/Documents/project/ios/.cocoapods/repos/flutter/.git
  Initialized empty Git repository in /Users/exampleUser/Documents/project/ios/.cocoapods/repos/flutter/.git/
  $ /usr/bin/git config core.sparsecheckout true
  $ /usr/bin/git -c core.sparsecheckout=true remote add origin -f https://github.com/flutter/flutter.git
  Fetching origin
  $ /usr/bin/git -c core.sparsecheckout=true fetch origin master
  $ /usr/bin/git -c core.sparsecheckout=true checkout -B master origin/master
  Switched to a new branch 'master'
  Branch 'master' set up to track remote branch 'master' from 'origin'.
  $ /usr/bin/git stash save --include-untracked
  $ /usr/bin/git stash drop
  $ /usr/bin/git checkout -- . && /usr/bin/git clean -dffx
  Checking out files: 100% (10080/10080), done.
  Switched to branch 'master'
  Your branch is up to date with 'origin/master'.
  $ /usr/bin/git -c core.sparsecheckout=true checkout a34ac6f1f0e77461a78be946248e49749150a067
  Note: checking out 'a34ac6f1f0e77461a78be946248e49749150a067'.

  You are in 'detached HEAD' state. You can look around, make experimental
  changes and commit them, and you can discard any commits you make in this
  state without impacting any branches by performing another checkout.
  
  If you want to create a new branch to retain commits you create, you may
  do so (now or later) by using -b with the checkout command again. Example:
  
    git checkout -b 
  
  HEAD is now at a34ac6f1f Merge pull request #93696 from HoIl9/patch-2
  config(release): Android X migration (#93422)
  $ /Users/exampleUser/flutter/bin/flutter --version
  Flutter 1.20.4 • channel stable • https://github.com/flutter/flutter.git
  Framework • revision fba99f6cf9 (7 days ago) • 2020-09-14 15:32:52 -0700
  Engine • revision d1bc06f032
  Tools • Dart 2.9.2
  
  Building macOS application...
  Debug service listening on ws://127.0.0.1:51667/ThoUEHsrKLw=
  Running application descriptor tests...                           6.3s (48 files, 5.3M)
  Running test/runnerTests.dart on iPhone 11 Pro Max in debug mode...

  WARNING: No target device found. Target fallback to emulator.         
  Running Xcode build...                                                  
                                    
  ├─Building Dart code...                                    1.1s
  ├─Generating dSYM file...                                 454ms
  └─Stripping debug symbols...                              373ms

  ├─Compiling, linking and signing...                  6.2s
  └─Xcode build done.                                           25.9s
  ✓  Built build/ios/iphoneos/Runner.app.
  An Observatory debugger and profiler on iPhone 11 Pro Max is available at: http://127.0.0.1:51715/RB-2RG-lhqbc=/
  Running [/usr/bin/xcrun simctl install 94918B8A-274C-4F14-8BDA-3A7C29B4ED67 /Users/exampleUser/Documents/project/build/ios/iphoneos/Runner.app]... (completed in 15,4s)
  ** BUILD FAILED **

  Xcode's output:
  ↳
      2020-09-22 15:41:15.753 xcodebuild[6868:35339]  DTDeviceKit: deviceType from 94918B8A-274C-4F14-8BDA-3A7C29B4ED67 was NULL
      === BUILD TARGET Runner OF PROJECT Runner WITH TARGET RunnerTests (1 errors) ===
  "/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild" -project "/Users/exampleUser/Documents/project/ios/Runner.xcodeproj" -scheme "Runner" -destination "id=94918B8A-274C-4F14-8BDA-3A7C29B4ED67" -sdk "iphonesimulator" -runnerTests -notesBuilding with sound null safetyAn

      ```sh
      [!] Unable to find a target named `RunnerTests` in project `Runner.xcodeproj`. Did find `Runner`.
      [!] Automatically assigning platform `iphonesimulator` with version `undefined` on target `Runner` because no platform was specified. Please specify a valid platform identifier and iOS version for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
      [!] Automatically assigning platform `iphonesimulator` with version `undefined` on target `Runner` because no platform was specified. Please specify a valid platform identifier and iOS version for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
      [!] Automatically assigning platform `iphonesimulator` with version `undefined` on target `Runner` because no platform was specified. Please specify a valid platform identifier and iOS version for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
      [!] Automatically assigning platform `iphonesimulator` with version `undefined` on target `Runner` because no platform was specified. Please specify a valid platform identifier and iOS version for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
  
      error: Specified target 'RunnerTests' does not exist in the project '/Users/exampleUser/Documents/project/ios/Runner.xcodeproj'.

      error: The project '/Users/exampleUser/Documents/project/ios/Runner.xcodeproj' does not contain a target named 'RunnerTests'.
      ```
      
    

Similar post

Leave a comment