Upgrading Amplify packages
Below are common problems that can occur when upgrading Amplify and suggestions on how to resolve the issues.
When does this occur?
On the first iOS build after upgrading the version of the Amplify packages in your
Below is an example of what the error will look like:
1[!] CocoaPods could not find compatible versions for pod "Amplify":2 In snapshot (Podfile.lock):3 Amplify (= 1.6.0)4 In Podfile:5 amplify_auth_cognito (from `.symlinks/plugins/amplify_auth_cognito/ios`) was resolved to 0.0.1, which depends on6 Amplify (> 1.9.2)7You have either:8 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.9 * changed the constraints of dependency `Amplify` inside your development pod `amplify_auth_cognito`.10 You should run `pod update Amplify` to apply changes you've made.
Why does this occur?
The flutter Amplify packages depend on native iOS Amplify libraries when targeting iOS. New versions of the flutter Amplify packages will often depend on new versions of the native iOS Amplify libraries. Your project will likely have a
Podfile.lock file that locks all pods to a specific version. The error message that you see is telling you that the version in your
Podfile.lock and the version required by the new version of the amplify flutter packages are conflicting.
- Option 1 (recommended): Run
pod update Amplify AWSPluginsCore AmplifyPluginsfrom the ios dir. This will update the pods that are used by the amplify flutter packages.
- Option 2: Delete the
Podfile.lock(in the ios dir) and rebuild. A new
Podfile.lockwill be generated. Please note, this may cause other non amplify related dependencies to be updated as well.
- Option 3: Run
pod updatefrom the ios dir. This should update your
Podfile.lockfile. Please note, this may cause other non amplify related dependencies to be updated as well.