skip to Main Content

using android studio i get the following error when launching the following command
flutter build ios

Building "my bundle id" for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: "my xcode project code"
Running pod install...                                           1,512ms
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`.

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

Error running pod install

my flutter doctor is also not 100% and dont know how to fix

[!] Flutter (Channel stable, 3.10.6, on macOS 13.5 22G74 darwin-x64, locale en-AU)
    ! Warning: `dart` on your path resolves to /usr/local/Cellar/dart/3.0.7/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Volumes/Macintosh
      HD/SDK/flutter. Consider adding /Volumes/Macintosh HD/SDK/flutter/bin to the front of your path.
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2022.3)
[✓] Connected device (1 available)
[✓] Network resources

I have done a decent amount of research but everything is suited for the new m1 and m2 chips
my mac uses and intel.

2

Answers


  1. Chosen as BEST ANSWER

    I Solved this by removing the ios folder from flutter redownloaded it and also redownloaded cocoapods

    solved it for me

    keep in mind there are different commands to install cocoapods for different mac cpu chips


  2. It appears that you are encountering two primary problems:

    1. CocoaPods Issue:
      The error message indicates that there’s a problem with CocoaPods during the flutter build ios process. Specifically, it mentions that it cannot locate the target named RunnerTests in the Xcode project. This can occur if there’s a discrepancy or inconsistency in your Xcode project configuration.

    To address this, try the following steps:

    a. Ensure you have the most recent version of CocoaPods installed. Open Terminal and execute:

    sudo gem install cocoapods
    

    b. Navigate to your Flutter project directory and remove the Podfile.lock and Pods directory:

    rm -rf ios/Podfile.lock ios/Pods
    

    c. Run flutter clean to eliminate any previously built artifacts.

    d. Execute pod install inside the ios directory of your Flutter project:

    cd ios
    pod install
    

    e. After successfully completing pod install, return to the root directory of your Flutter project and try running flutter build ios again:

    flutter build ios
    
    1. Flutter doctor warning:
      The flutter doctor output indicates that your dart command is pointing to a different Dart SDK than the one used by your Flutter SDK. To resolve this, you can add the Flutter SDK’s bin directory to your PATH environment variable.

    To do that:

    a. Open your shell profile file (e.g., .bash_profile, .zshrc, or .bashrc). For instance, if you are using the Bash shell, you can run:

    nano ~/.bash_profile
    

    b. Add the following line to the file (modify the path to your Flutter SDK location if needed):

    export PATH="/Volumes/Macintosh HD/SDK/flutter/bin:$PATH"
    

    c. Save the file and exit the text editor.

    d. Restart your terminal or run source <profile_file> to apply the changes:

    source ~/.bash_profile
    

    After applying the changes, you can verify that your Flutter SDK’s dart command is being used by running:

    which dart
    

    It should display the path to your Flutter SDK’s Dart executable.

    Once you’ve made these adjustments, try running flutter doctor again to see if the warning is resolved:

    flutter doctor
    

    These steps should assist you in resolving the issues you are encountering. If you come across any other errors, feel free to ask for further assistance.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search