3

I'm very new on Mac / iOS development with Xcode and I have trouble on building my App. I work since 4 days on that issue, but I have no more ideas to find the reason.

The App has 6 projects, bundled in a xcworkspace. I added via cocoapods and via terminal with command pod install RxSwift, RxCocoa, OMGHTTPURLRQ, PromiseKit and SVWebViewController successfully. The projects without dependencies could build successfully. Two projects (libraries) with command "import RxCocoa" and "import RxSwift" in *.swift files are failed with error "No such module 'RxCocoa'".

I read some Stackoverflow posts and the RxSwift Git documentation to solve the issue, without success.

Screenshot of build error and added reference

Podfile definition:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.1'
use_frameworks!
target 'CheckMyBus' do
    pod "OMGHTTPURLRQ", "~> 3.1.2“
    pod "RxSwift", "~> 2.3.0"
    pod 'RxCocoa', '~> 2.3.0'
    pod 'PromiseKit', '~> 3.2.1'
    pod 'SVWebViewController', '~> 0.2‘
end

Pods installation via terminal:

MacMinis-Mac-mini:CheckMyBus MacMini$ pod install
Analyzing dependencies
Downloading dependencies
Using OMGHTTPURLRQ (3.1.3)
Using PromiseKit (3.2.1)
Using RxCocoa (2.3.1)
Using RxSwift (2.3.1)
Using SVWebViewController (0.2)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 5 dependencies from the Podfile and 5 total pods installed.

[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.

[!] The `CheckMyBus [Debug]` target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT` build setting defined in `Pods/Target Support Files/Pods-CheckMyBus/Pods-CheckMyBus.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `CheckMyBus [Release]` target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT` build setting defined in `Pods/Target Support Files/Pods-CheckMyBus/Pods-CheckMyBus.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.
MacMinis-Mac-mini:CheckMyBus MacMini$ 

Can anybody help me?

1
  • I get this "red line" error as well on occasion. Assuming you've tried to build the project, make sure the Pod actually exists on your file system, make sure it builds on its own (according to the developer's page on, for example, GitHub) under the version of Swift you're using. In one case, I had to point my Podfile to a local version of the Pod. I wish I had the one answer that fixed it, but — I usually end up fussing quite a bit before landing on the solution.
    – bleeckerj
    Commented Feb 5, 2017 at 23:38

2 Answers 2

0

I solved the issue. The solution was so simple, but I had previously found no documentation to use pods with several libraries.

I forgot to add pods definitions in the Podfile for the libraries.

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.1'
workspace 'MyWorkspace'
use_frameworks!

target 'MainProj' do
    pod "OMGHTTPURLRQ", "~> 3.1.2“
    pod "RxSwift", "~> 2.3.0"
    pod 'RxCocoa', '~> 2.3.0'
    pod 'PromiseKit', '~> 3.2.1'
    pod 'SVWebViewController', '~> 0.2‘
    project 'MainProj'
end

target 'Lib1' do
    pod "RxSwift", "~> 2.3.0"
    pod 'RxCocoa', '~> 2.3.0'
    project 'Lib1/Lib1.xcodeproj'
end

target 'Lib2' do
    pod "OMGHTTPURLRQ", "~> 3.1.2“
    pod "RxSwift", "~> 2.3.0"
    pod 'RxCocoa', '~> 2.3.0'
    project 'Lib2/Lib2.xcodeproj'
end

-2

Note: Build works, but not Test! Explanation: CocoaPods Podfile config issue. The given pod/framework is specified for the non test main target, maybe even for the (unit) Test target, but not for the UI Test target! E.g.: platform :ios, '9.0' use_frameworks! target 'Xyz' do pod 'MessageK…

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.