4

I am trying to organize a project in several modules. To simplify I have two modules:

  • iOSAppModule - It is the top module
    • DataProviderModule - Used by the iOSAppModule

So iOSAppModule is a project that depends on DataProviderModule. Therefore, DataProviderModule is a sub-project of iOSAppModule.

DataProviderModule works independently of the iOSAppModule. It has two targets: DataProviderModuleUI and DataProviderModuleStatic. DataProviderModuleUI is a target that provides a UI so externals can test the DataProviderModule. DataProviderModuleStatic is a Cocoa Touch Static Library that strips down the UI classes.

Now, the problem is: I am using cocoapods in the DataProviderModule and I can't use the DataProviderModule (with the Static target) on the iOSAppModule because it can't find the lPods.

Here is my current PodFile in DataProviderModule:

platform :ios, '5.0'

link_with ['DataProviderModuleUI', 'DataProviderModuleStatic']
pod 'MKNetworkKit', '~> 0.87'

The iOSAppModule doesn't use pods.

2 Answers 2

1

You can make almost any setup work if you use the --no-integrate option with the pod command. You have to connect the Pod project to your project manually, but you have a lot more flexibility.

In your case, just make the Pod project a subproject of DataProviderModule and set the header, library, and build paths accordingly. See this page for step-by-step instructions.

Sign up to request clarification or add additional context in comments.

Comments

0

Your issue is likely related to CocoaPods not supporting target de-integration. I.e. if you integrated a target in the past with CocoaPods you need to remove the Pods library from its build phases and unset the CocoaPods configuration file.

As the final target is not integrated with CocoaPods you also need to included any system Framework/library manually and any other required build flag. The CocoaPods generated xcconfig serves to this purpose but it is relative to the dependencies of the target.

A couple of notes:

  • CocoaPods for the time being doesn't support linking with static libraries without some sort of manual intervention.
  • You might need to specify the project of a target using the xcodeproj DSL directive.

1 Comment

I cleaned the project (build phases, linkage with the pods, pods.xconfig) and installed again and I have the same problem. Since I can't add a workspace as subproject of the main project I will always have a problem linking with the pods in the subproject.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.