0

I recently updated android studio to Flamingo | 2022.2.1 Patch 2 and the followed by updating Flutter and all of its packages. previously, when I ran flutter build ipa in the terminal in android studio, it would build my apps .ipa without any trouble. now that I've updated android studio I'm getting the below error when i run flutter build ipa.

`development@NC-MBP my_app % flutter build ipa

Archiving com.crossfiregames.my_app... Signing iOS app for device deployment using developer identity: "Apple Development: NC (XKJ4653QSG)" Running pod install... 299ms CocoaPods' output: ↳ Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
[!] Unable to find a target named `RunnerTests` in project `Runner.xcodeproj`, did find `Runner`.

/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer/target_inspector.rb:108:in `compute_targets'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer/target_inspector.rb:40:in `compute_results'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1197:in `block (3 levels) in inspect_targets_to_integrate'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1195:in `each'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1195:in `block (2 levels) in inspect_targets_to_integrate'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1193:in `each'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1193:in `block in inspect_targets_to_integrate'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1188:in `inspect_targets_to_integrate'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:107:in `analyze'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:422:in `analyze'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:244:in `block in resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:243:in `resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:162:in `install!'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/bin/pod:25:in `load'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/bin/pod:25:in `<main>'

Error running pod install`

I tried searching for the error that it is giving me, [!] Unable to find a target named RunnerTests in project Runner.xcodeproj, did find Runner.

but cannot find much info about it. has anyone had this trouble before? and if so, how do i go ahead and fix it please? I'm new to flutter and this is beyond me.

thanks so much

Nomad09
  • 161
  • 8
  • it has something to do with google mobile ads. I went back to a previous version of the app and tried the building the .ipa and it worked! I then went through the missing dependencies and ran the build after each one and it failed after adding google_mobile_ads have no idea how to fix this though because my app needs these ads. – Nomad09 Jun 08 '23 at 15:01
  • 1
    does this https://stackoverflow.com/questions/76247185/unable-to-find-a-target-named-runnertests-in-project-runner-xcodeproj help? – Nik Rubblers Jun 13 '23 at 09:25

3 Answers3

0

As a workaround, I typically flutter clean.

If that doesn't work, rm -r ios and flutter create --platforms=ios, which recreates the iOS directory. If you still can't build, please file an issue at github.com/flutter/flutter/issues/new/choose

Pierre
  • 308
  • 1
  • 3
  • 9
  • hi, that hasn't worked. when i run the flutter create part it returns the error No option specified for the output directory. – Nomad09 Jun 12 '23 at 10:57
  • you specify a directory at the end, e.g. `flutter create --platforms=ios .` – Pierre Jun 13 '23 at 14:26
  • Hi, sorry, how is the command supposed to look? I tried flutter create --platforms=ios /Users/my_computer/Development/apps/my_app and got the error: "my_app" is not a valid Dart package name. – Nomad09 Jun 14 '23 at 11:34
  • See https://stackoverflow.com/questions/67757656/i-am-getting-the-following-error-on-running-flutter-create-my-appname-my-appna for more info on this error – Pierre Jun 16 '23 at 15:29
0

According to the error message, it seems that there is an issue with the project CocoaPods configuration. In this case, let's try the following steps:

  • From the terminal, in the root directory of the project run

    pod repo update
    

    In case of not having CocoaPods installed, run sudo gem install cocoapods.


  • Next, reinstall the CocoaPods dependencies, by running the following commands:

    rm ios/Podfile.lock
    rm -rf ios/Pods
    pod install --project-directory=ios
    

They remove the existing Podfile.lock file, the "Pods" directory thus reinstalling the CocoaPods dependencies.

Finally, run flutter build ipa.

Ahmad F
  • 30,560
  • 17
  • 97
  • 143
  • thanks so much. followed your instructions and it took me back to my first problem of the error: Analyzing dependencies [!] Unable to find a target named `RunnerTests` in project `Runner.xcodeproj`, did find `Runner`. when running: pod install --project-directory=ios – Nomad09 Jun 14 '23 at 11:29
0

Ok, found out how to fix it. in the podfile, you need to find the below text,

    target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
#   target 'RunnerTests' do
#     inherit! :search_paths
#   end
end

and then comment out (#) the parts that are commented out. then it will build as usual

Nomad09
  • 161
  • 8