System: Apple Macbook pro 14 Inch
Processor: M1 chip
IDE- Android Studio Giraffe,
Issue -
Warning: CocoaPods not installed. Skipping pod install.CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.Without CocoaPods, plugins will not work on iOS or macOS.For more info, see https://flutter.dev/platform-pluginsTo install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
Cocoapods not installed or not in valid state. Error launching application on iPhone 14 Pro.
[✓] Flutter (Channel stable, 3.10.6, on macOS 12.5.1 21G83 darwin-arm64, locale en-IN)
• Flutter version 3.10.6 on channel stable at /Users/harshalchaudhari/tools/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f468f3366c (2 weeks ago), 2023-07-12 15:19:05 -0700
• Engine revision cdbeda788a
• Dart version 3.0.6
• DevTools version 2.23.1
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /Users/harshalchaudhari/Library/Android/sdk
• Platform android-33, build-tools 32.1.0-rc1
• ANDROID_HOME = /Users/harshalchaudhari/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14C18
• CocoaPods version 1.12.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
[✓] Connected device (3 available)
• iPhone 14 Pro (mobile) • DC6820ED-9CF9-4A9D-9CE2-CE9DF71EDC88 • ios • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.5.1 21G83 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 115.0.5790.102
[✓] Network resources
• All expected network resources are available.
• No issues found!
After ran flutter doctor Cocoapods is present on my device with 1.12.1 version but still IOS build is not compiling.
For reference i'm attaching more detailed logs which is generated using flutter run -v, find below logs and suggest which step i'm missing
[ +5 ms] Error running pod install
[ ] Error launching application on iPhone 14 Pro.
[ +2 ms] "flutter run" took 16,152ms.
[ +1 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:757:9)
<asynchronous suspension>
#2 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1336:27)
<asynchronous suspension>
#3 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#4 CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#5 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:296:9)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:244:5)
<asynchronous suspension>
#8 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:91:9)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#10 main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>
I tried multiple things such as :
Firstly i try to run project which generated by Android studio which working fine on Both Android and IOS device. But when i try to add more screens and added few more dependencies inside pubspec.yaml. After this Android build is running successfully but IOS build were giving above mentioned issue.
To handle this As mentioned in issue i tried to installed Cocoapods from brew as well as from gem using this command respectively "brew install cocoapods" and "sudo gem install cocoapods" but still from Android IOS buid is not compiling properly. So just to verify if Cocoapods installed correctly or not i ran "flutter doctor - v" it generates output as mentioned below