flutter / flutter/flutter-intellij

Flutter configuration template unable to resolve `cocoapods` on initial build for iOS

Open
#8,611 1 comment 0 reactions 0 assignees View on GitHub
⌺‬ platform-ios P2 platform-android-studio reproduce-to-verify topic-debugging
Dominant language
Java
Stars
2k
Forks
356
Avg merge
1d 11h
Merged PRs (30d)
27

Description

## Steps to Reproduce
On Android Studio, when building and launching a Flutter project targeting an iOS simulator, with a default Flutter configuration setup that contains only the "Dart entrypoint" (see screenshot attached):

Image

Running the configuration fails, with Android Studio Console Output:
```
Launching lib/main.dart on iPhone 16e in debug mode...
Warning: CocoaPods not installed. Skipping pod install.
CocoaPods is a package manager for iOS or macOS platform code.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/to/platform-plugins
For installation instructions, see https://guides.cocoapods.org/using/getting-started.html#installation

CocoaPods not installed or not in valid state.
Error launching application on iPhone 16e.
```

***

However, if I run the build manually using shell command (with the Android Studio embedded terminal):
```shell
flutter run -d "iPhone 16e"
```

**Not only that the build succeeds and launches on the iOS simulator as expected,
ALL subsequent runs through the configuration works.** The `CocoaPods not installed` issue is magically gone.

The issue can be simulated once again if I clean the project build directory `./build`.

## Version info
On macOS Tahoe 26.1 Apple M4 Pro, running in Android Studio's embedded terminal with `PowerShell 7.5.4`, the output from `flutter doctor -v` is:
```
[✓] Flutter (Channel stable, 3.35.7, on macOS 26.1 25B78 darwin-arm64, locale en-US) [233ms]
• Flutter version 3.35.7 on channel stable at /Users/ckt/Library/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision adc9010625 (3 weeks ago), 2025-10-21 14:16:03 -0400
• Engine revision 035316565a
• Dart version 3.9.2
• DevTools version 2.48.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging

[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0-rc1) [1,078ms]
• Android SDK at /Users/ckt/Library/Android/sdk
• Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
• Platform android-36, build-tools 36.1.0-rc1
• ANDROID_HOME = /Users/ckt/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.7+-13880790-b1038.58)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.0.1) [454ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 17A400
• CocoaPods version 1.16.2

[✓] Chrome - develop for the web [16ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2025.1) [15ms]
• 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 21.0.7+-13880790-b1038.58)

[✓] IntelliJ IDEA Community Edition (version 2025.2.1) [15ms]
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• 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

[✓] VS Code (version 1.105.1) [3ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.122.0

[✓] Connected device (3 available) [5.6s]
• iPhone 16e (mobile) • 5862FC21-71C1-4A45-BF2D-D77039B0D00E • ios • com.apple.CoreSimulator.SimRuntime.iOS-26-0 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 26.1 25B78 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 142.0.7444.135

[✓] Network resources [290ms]
• All expected network resources are available.

• No issues found!
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.