diff --git a/sites/docs/src/content/packages-and-plugins/swift-package-manager/for-app-developers.md b/sites/docs/src/content/packages-and-plugins/swift-package-manager/for-app-developers.md index 3d7a5077fe..cee54cd1fe 100644 --- a/sites/docs/src/content/packages-and-plugins/swift-package-manager/for-app-developers.md +++ b/sites/docs/src/content/packages-and-plugins/swift-package-manager/for-app-developers.md @@ -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. +::: + + + + +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 + ``` + + + + +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` + 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 + ``` + + + ## How to add Swift Package Manager integration manually @@ -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