Migrate from Cocoapods to SPM

📘

Support for SPM (iOS)

CocoaPods trunk is becoming read-only. Apps that use CocoaPods will keep working, but new versions of the IDWise iOS SDK's dependencies will only be available through Swift Package Manager (SPM). Here's how to move your Flutter app's iOS build to SPM.

Requirements

RequirementVersion
idwise_flutter_sdk7.1.0 or later
Flutter3.27 or later (3.44+ recommended)
Xcode15.3 or later
iOS deployment target15.6 or later

1. Update the SDK

In your app's pubspec.yaml:

dependencies:
  idwise_flutter_sdk: 7.1.0

2. Turn on Swift Package Manager

How you turn it on depends on your Flutter version. Check it with flutter --version.

Flutter versionWhat to do
3.44 or laterNothing. SPM is on by default.
3.35 – 3.43Add the setting below to your app's pubspec.yaml.
3.27 – 3.34Run flutter config --enable-swift-package-manager.

For Flutter 3.35 – 3.43, add this under flutter: in your app's pubspec.yaml:

flutter:
  config:
    enable-swift-package-manager: true

3. Set the iOS deployment target

  1. Open ios/Runner.xcworkspace in Xcode.
  2. Select the Runner target, then the General tab.
  3. Under Minimum Deployments, set iOS to 15.6 or later.

4. Remove the IDWise source from your Podfile

In ios/Podfile, delete this line:

source 'https://github.com/idwise/ios-sdk'

Keep the rest of the Podfile if other plugins in your app still use CocoaPods.

5. Install

flutter clean
flutter pub get
flutter run

Flutter adds Swift Package Manager to your Xcode project and downloads the IDWise SDK automatically.

6. Check that SPM is in use

Open ios/Runner.xcworkspace in Xcode. idwise-ios-sdk should appear under Package Dependencies.

Commit the files Flutter changed, including ios/Runner.xcodeproj/project.pbxproj and ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved.

Troubleshooting

ProblemFix
"The package product requires minimum platform version 15.6"Set the deployment target to 15.6 (step 3).
The app still installs IDWise through CocoaPodsRun the commands from your app's root folder, or run flutter config --enable-swift-package-manager.
The config: setting in pubspec.yaml has no effectYour Flutter version is older than 3.35. Use flutter config --enable-swift-package-manager instead.

Need to go back?

  1. Set enable-swift-package-manager: false in your pubspec.yaml. If you used flutter config, run flutter config --no-enable-swift-package-manager instead.
  2. Add source 'https://github.com/idwise/ios-sdk' back to ios/Podfile, together with source 'https://cdn.cocoapods.org/'.
  3. Run the install steps again.

The IDWise SDK switches back to CocoaPods.


Did this page help you?