Andrei Herford
Andrei Herford

Reputation: 18729

How to install a CocoaPod that requires macOS 10.10 in a project with deployment target 10.7?

I am working on an existing macOS project that uses 10.7 as deployment target. The app supports using Dropbox (API v1 / Core API) for quite a while. Since this API will be shutdown in couple of month, I am updating the App to use API v2 instead.

Unfortunately the official Objectiv-C SDK requires 10.10 as minimum deployment target. Thus when trying to install the SDK using CocoaPods I get the following error.

[!] Unable to satisfy the following requirements:

  • ObjectiveDropboxOfficial required by Podfile

Specs satisfying the ObjectiveDropboxOfficial dependency were found, but they required a higher minimum deployment target.

Of course the obvious solution would be to update the whole project to use 10.10 as deployment target. However the app just runs fine with the older versions of macOS and a lot of users still use them.

Is there anyway to include the SDK, keep 10.7 as deployment target and only use the SDK features, if the app runs on 10.10+?

That way existing users would only loose the Dropbox features while still be able to use all other features. This would still be better than excluding these users from all future updates.

Upvotes: 0

Views: 80

Answers (1)

Andrei Herford
Andrei Herford

Reputation: 18729

Meanwhile I was able to find an answer:

While it is no problem to change the deployment-target within the Podfile to 10.10 and thus to include the SDK into a project that still uses 10.7 as target, this app will crash as soon as it is executed on macOS < 10.10.

It does not work to check the macOS version and to only use the SDK/code in 10.10+. The app will automatically load the SDK/framework and this will lead to the crash.

Upvotes: 0

Related Questions