Xcode/Cocoapods not resolving dependencies on macbook with Monterey 12.2.1

Trying to build flutter application using Xcode and Cocoapods not resolving dependencies.

I created a new app with no dependencies and it was built and loaded correctly on iOS emulator and physical device. The issue arises when there are dependencies, in this case flutter_barcode_scanner and flutter_share.

===>Error in Terminal after running 'flutter run':

Launching lib/main.dart on iPhone 13 in debug mode... Running pod install...                      2,551ms CocoaPods' output: ↳    Preparing

  Analyzing dependencies

  Inspecting targets to integrate    Using ARCHS setting to build architectures of target Pods-Runner: (``)

  Fetching external sources   -> Fetching podspec for Flutter from Flutter   -> Fetching podspec for flutter_barcode_scanner from   .symlinks/plugins/flutter_barcode_scanner/ios   -> Fetching podspec for flutter_share from   .symlinks/plugins/flutter_share/ios

  Resolving dependencies of Podfile    CDN: trunk Relative path downloaded: CocoaPods-version.yml, save ETag:    "620b888f-38"   [!] CocoaPods could not find compatible versions for pod   "flutter_barcode_scanner":    In Podfile:     flutter_barcode_scanner (from     .symlinks/plugins/flutter_barcode_scanner/ios)

  Specs satisfying the flutter_barcode_scanner (from   .symlinks/plugins/flutter_barcode_scanner/ios) dependency were found, but   they required a higher minimum deployment target.

  /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/molinillo-0.8.0/lib/mol   inillo/resolution.rb:317:in raise_error_unless_state'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/molinillo-0.8.0/lib/mol   inillo/resolution.rb:299:in block in unwind_for_conflict'   internal:kernel:90:in tap'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/molinillo-0.8.0/lib/mol   inillo/resolution.rb:297:in unwind_for_conflict'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/molinillo-0.8.0/lib/mol   inillo/resolution.rb:682:in attempt_to_activate'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/molinillo-0.8.0/lib/mol   inillo/resolution.rb:254:in process_topmost_state'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/molinillo-0.8.0/lib/mol   inillo/resolution.rb:182:in resolve'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/molinillo-0.8.0/lib/mol   inillo/resolver.rb:43:in resolve'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/co   coapods/resolver.rb:94:in resolve'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/co   coapods/installer/analyzer.rb:1078:in block in resolve_dependencies'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/co   coapods/user_interface.rb:64:in section'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/co   coapods/installer/analyzer.rb:1076:in resolve_dependencies'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/co   coapods/installer/analyzer.rb:124:in analyze'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/co   coapods/installer.rb:416:in analyze'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/co   coapods/installer.rb:241:in block in resolve_dependencies'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/co   coapods/user_interface.rb:64:in section'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/co   coapods/installer.rb:240:in resolve_dependencies'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/co   coapods/installer.rb:161:in install!'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/co   coapods/command/install.rb:52:in run'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/claide-1.1.0/lib/claide   /command.rb:334:in run'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/co   coapods/command.rb:52:in run'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/bin/po   d:55:in <top (required)>'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/bin/pod:25:in load'   /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/bin/pod:25:in '

Error output from CocoaPods: ↳

  [!] Automatically assigning platform iOS with version 9.0 on target   Runner because no platform was specified. Please specify a platform for   this target in your Podfile. See   https://guides.cocoapods.org/syntax/podfile.html#platform.

Error running pod install Error launching application on iPhone 13.

===>Error in Xcode // // Generated file. Do not edit. //

// clang-format off

#import "GeneratedPluginRegistrant.h"

#if __has_include(<flutter_barcode_scanner/SwiftFlutterBarcodeScannerPlugin.h>) #import <flutter_barcode_scanner/SwiftFlutterBarcodeScannerPlugin.h> #else @import flutter_barcode_scanner; #endif

#if __has_include(<flutter_share/FlutterSharePlugin.h>) #import <flutter_share/FlutterSharePlugin.h> #else @import flutter_share; #endif

@implementation GeneratedPluginRegistrant

  • (void)registerWithRegistry:(NSObject*)registry {

 [SwiftFlutterBarcodeScannerPlugin registerWithRegistrar:[registry registrarForPlugin:@"SwiftFlutterBarcodeScannerPlugin"]];  [FlutterSharePlugin registerWithRegistrar:[registry registrarForPlugin:@"FlutterSharePlugin"]]; }

@end

==>Additional info

I tried to build changing platform iOS to version 12.0 on target  Runner, removing Podfile and Podfile.lock, removing the folder ios and recreating using 'flutter create -i swift'.

Also, I ran 'flutter pub get' to sync dependencies.

==> Flutter doctor output

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.10.1, on macOS 12.2.1 21D62 darwin-arm, locale   en-NZ) [✓] Android toolchain - develop for Android devices (Android SDK version   32.1.0-rc1) [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.1) [✓] Connected device (2 available) [✓] HTTP Host Availability

• No issues found!

Solved. After unsuccessfully applying changes using Xcode, which included deployment target, it worked after setting target in the podfile manually.

Xcode/Cocoapods not resolving dependencies on macbook with Monterey 12.2.1
 
 
Q