This project is intended to illustrate an issue I'm having with CocoaPods.
To observe the issue, do the following:
- Open
CocoaPods-Test.xcworkspacein Xcode. - Note that the
CocoaPods-Testtarget builds and runs successfully, importingPromiseKitandTwilioChatClientpods. - Navigate to
Playground.playgroundwithin the workspace. - Note that the playground executes fine while importing
PromiseKitbut ifTwilioChatClientis imported, playground execution fails with "no such module 'TwilioChatClient'".
After reading the following resources:
- CocoaPods/CocoaPods#5334
- CocoaPods/CocoaPods#5215
- CocoaPods/CocoaPods#5563
- CocoaPods/swift#3
- CocoaPods/CocoaPods#4135
- CocoaPods/CocoaPods#2240
- CocoaPods/CocoaPods#6669 (comment)
- https://guides.cocoapods.org/using/troubleshooting.html
- https://www.objc.io/issues/6-build-tools/cocoapods-under-the-hood/
I think the issue is probably related to the fact that TwilioChatClient is a "vendored framework" (see its podspec), which means a pod target is not created for it. After reading the above resources, I feel like a solution is within reach, but I can't quite figure it out.
While the sample project here illustrates what I think is the underlying issue, the issue that prompted me to create this example project is just a small bit more complicated.
In my project, I create a framework target containing all my app's code (so it can be imported into my app and also into my playgrounds using app resources). This framework then has pod dependencies, including PromiseKit and TwilioChatClient. The execution error in the playground is different ("Couldn't lookup symbols" instead of "no such module"), as I am not importing the CocoaPods module directly but my framework which uses the pod framework.
I suspect if I can solve the "no such module" issue, it will help me solve my "couldn't lookup symbols" issue.