AWSAppSync and AWSMobileClient incompatible

698 views Asked by At

I am trying to install AWSAppSync and AWSMobileClient to my ios app. When I want to use pod install.

I have tried to use only AWSAppSync or AWSMobileClient. They are fine when used alone but they don't work in the same pod file. I also tried different version of AWSAppSync and AWSCore. AWSCore 2.7.0 or 2.8.0 doesn't make difference in this case. Different version of AWSAppSync return the same error.

#installed 
#pod 'AWSCore', '~> 2.8.0'

pod 'AWSAppSync', '~> 2.6.24'

pod 'AWSMobileClient', '~> 2.8.0'
pod 'AWSAuthUI', '~> 2.8.0'
pod 'AWSUserPoolsSignIn', '~> 2.8.0'

This is what's returned:

[!] CocoaPods could not find compatible versions for pod "AWSCore":
In snapshot (Podfile.lock):
  AWSCore (= 2.7.4, ~> 2.7.0)

In Podfile:
  AWSAppSync (~> 2.6.24) was resolved to 2.6.25, which depends on
  AWSCore (~> 2.7.0)

  AWSMobileClient (~> 2.8.0) was resolved to 2.8.0, which depends on
  AWSAuthCore (= 2.8.0) was resolved to 2.8.0, which depends on
  AWSCore (= 2.8.0)
1

There are 1 answers

2
Palpatim On

Generally speaking, it's necessary to use compatible versions of the AWSAppSync and AWSiOSSDK (which provides AWSCore, AWSMobileClient, etc). The best way to do that is to let the resolved dependencies flow from the version of AWSAppSync you want to use. For example, if you are using AppSync 2.6.24, then you should be using ~> 2.6.0 versions of the dependent libraries. Since it looks like you want to use AWSMobileClient for auth, you'll need to upgrade AWSAppSync to a newer version.

Do you still encounter the problem using the latest AWSAppSync version (2.8.0)? I've successfully used that with the latest AWSMobileClient (2.8.1). And just to be sure, are you issuing a pod repo update before the pod install, or invoking pod install --repo-update to ensure the Spec repo is up to date? Here's a configuration I'm using successfully in an app that uses AWSAppSync:

target 'PostsApp' do
  use_frameworks!
  pod 'AWSAppSync', '~> 2.8.0'
  pod 'AWSMobileClient', '~> 2.8.0'
  pod 'AWSAuthUI', '~> 2.8.0'
  pod 'AWSUserPoolsSignIn', '~> 2.8.0'
end

Which resolves to the following (taken from Podfile.lock):

PODS:
  - AWSAppSync (2.8.0):
    - AWSCore (~> 2.8.0)
    - ReachabilitySwift (~> 4.3.0)
    - SQLite.swift (= 0.11.5)
  - AWSAuthCore (2.8.1):
    - AWSCore (= 2.8.1)
  - AWSAuthUI (2.8.1):
    - AWSAuthCore (= 2.8.1)
    - AWSCore (= 2.8.1)
  - AWSCognitoIdentityProvider (2.8.1):
    - AWSCognitoIdentityProviderASF (= 1.0.1)
    - AWSCore (= 2.8.1)
  - AWSCognitoIdentityProviderASF (1.0.1)
  - AWSCore (2.8.1)
  - AWSMobileClient (2.8.1):
    - AWSAuthCore (= 2.8.1)
    - AWSCognitoIdentityProvider (= 2.8.1)
  - AWSUserPoolsSignIn (2.8.1):
    - AWSAuthCore (= 2.8.1)
    - AWSCognitoIdentityProvider (= 2.8.1)
  - ReachabilitySwift (4.3.0)
  - SQLite.swift (0.11.5):
    - SQLite.swift/standard (= 0.11.5)
  - SQLite.swift/standard (0.11.5)