Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,92 @@ yet support Swift Package Manager.
If you previously disabled SwiftPM, you might need to enable it with
`flutter config --enable-swift-package-manager`.

If automatic migration works for you, that's it!
You are done with this page.
If automatic migration works for you and all of your dependencies
support Swift Package Manager,
you can [remove CocoaPods integration][removeCocoaPods].

## How to remove CocoaPods integration

**Flutter falls back to CocoaPods if any of your project dependencies
do not support Swift Package Manager.**
Ensure that all plugins in your project support Swift Package Manager
before removing CocoaPods.

:::note
If you have manually edited your `Podfile` to add CocoaPod
dependencies or logic other than Flutter plugins,
you must manually remove those changes.
:::

<Tabs key="darwin-platform">
<Tab name="iOS project">

To remove CocoaPods from your project, use the following steps.

1. To de-integrate CocoaPods from your Xcode projects, run:

```sh
cd ios
pod deintegrate
cd ..
```

2. Delete CocoaPods-related files and directories:

Delete `ios/Podfile`, `ios/Podfile.lock`,
the `ios/Pods/` directory, and
the `ios/.symlinks/` directory (if present).

3. Check your configuration files:

In `ios/Flutter/Debug.xcconfig`
and `ios/Flutter/Release.xcconfig`
remove any `#include` lines referencing `Pods/Target Support Files`
or CocoaPods `.xcconfig` files if they are still present.

4. Clean and build your project to verify the migration:

```sh
flutter clean
flutter pub get
flutter run
```

</Tab>
<Tab name="macOS project">

To remove CocoaPods from your project, use the following steps.

1. To de-integrate CocoaPods from your Xcode projects, run:

```sh
cd macos
pod deintegrate
cd ..
```

2. Delete CocoaPods-related files and directories:

Delete `macos/Podfile`, the `macos/Pods/` directory,
and the `macos/.symlinks/` directory (if present).

3. Check your configuration files:

In `macos/Flutter/Debug.xcconfig`, `macos/Flutter/Profile.xcconfig`,
and `macos/Flutter/Release.xcconfig`
Comment on lines +113 to +114

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In `macos/Flutter/Debug.xcconfig`, `macos/Flutter/Profile.xcconfig`,
and `macos/Flutter/Release.xcconfig`
In `macos/Flutter/Flutter-Debug.xcconfig` and `macos/Flutter/Flutter-Release.xcconfig`

remove any `#include` lines referencing `Pods/Target Support Files`
or CocoaPods `.xcconfig` files if they are still present.

4. Clean and build your project to verify the migration:

```sh
flutter clean
flutter pub get
flutter run
```

</Tab>
</Tabs>

## How to add Swift Package Manager integration manually

Expand Down Expand Up @@ -223,4 +307,5 @@ This turns off Swift Package Manager for the current user.
If a project is incompatible with Swift Package Manager,
all contributors need to run this command.

[removeCocoaPods]: #how-to-remove-cocoapods-integration
[removeSPM]: #how-to-remove-swift-package-manager-integration
Loading