user3532505
user3532505

Reputation: 419

Support CocoaPod and Carthage

I've created and published a Cocoapod using pod lib create. Now I also want to support Carthage, but after adding the path to the GitHub project to my Cartfile and running carthage update --platform iOS I'm getting the following error:

Dependency "" has no shared framework schemes for any of the platforms: iOS

Any idea how to fix this?

Upvotes: 2

Views: 675

Answers (1)

Amer Hukic
Amer Hukic

Reputation: 1524

How it should work:

To add support for Carthage for your existing CocoaPods library you need to share the scheme of your CocoaPods project. To do that you have to:

  1. Open the workspace that contains your pod (it should contain example and Pods projects).
  2. Go to Product > Scheme > Manage Schemes.
  3. Select the Shared checkbox for your pod scheme (scheme with the name of your library in Pods project).

Test if the scheme builds successfully by running carthage build --no-skip-current.

Possible problems

If you created your pod using pod lib create you might see that all schemes are already shared but carthage build --no-skip-current still fails with error message:
Dependency "" has no shared framework schemes for any of the platforms: iOS

This is because Xcode shows that the schemes are shared but the .xcodeproj/xcshareddata/xcschemes/YourProjectName.xcscheme file that marks the scheme as shared is missing. To fix this just uncheck and check the scheme sharing checkbox and the file should be created. Now you just need to commit and push the file to your repository.

Upvotes: 1

Related Questions