Xcode and Cocoapods "No such module" error

I recently upgraded to Xcode 8 and an existing project for Swift 3. After many problems with Cocoapods, I decided to start from scratch. After running pod deintegrate and removing Podfile , Podfile.lock and [Project].xcworkspace , I had a clean slate before Cocoapods.

Then I did the following:

  • I opened the terminal at the project site and launched pod init , then pod install (using the stub file created by pod init ).

    This turned out to be successful, but with the following two warnings:

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

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

At this point, opening Xcode and building the project gives the error "There is no such module," which is quite expected.

Following the instructions of this question , this problem is resolved, and the reuse of pod install is successful.

  1. Closed Xcode, the added modules that I use in the subfile (see below) ran pod install again. According to the terminal findings, this is successful.

  2. Opened Xcode and built a project. I get the error "No such module" again, in particular No such module 'ReactiveCocoa'

    I confirmed that the same problem occurs with SnapKit, Hue, KMPlaceholderTextView, KeychainSwift and Siren depending on the order of the import statements. For some reason, this problem does not affect any of the Google modules.

My subfile:

 # Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target 'Xena' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! # Pods for Xena pod 'ReactiveCocoa', :git => 'https://github.com/ReactiveCocoa/ReactiveCocoa.git' pod 'SnapKit', '~> 3.0.2' pod 'Hue', '~> 2.0.1' pod 'KMPlaceholderTextView', '~> 1.3.0' pod 'GooglePlacePicker' pod 'GooglePlaces' pod 'GoogleMaps' pod 'KeychainSwift', '~> 7.0' pod 'Siren' target 'XenaTests' do inherit! :search_paths # Pods for testing end target 'XenaUITests' do inherit! :search_paths # Pods for testing end end 
+6
source share
3 answers

Make sure you open the .xcworkspace file, not the .xcodeproj .

You can study this post .

Also in the section: Purpose> General> Related Structures and Libraries Make sure your framework is there. Even Pods_Xena.framework is

+9
source

Try:

Xcode β†’ Settings β†’ Location β†’ DerivedData p>

open the DerivedData folder and move it to the trash

+4
source

Uncomment the following line to determine the global platform for your project.

 platform :iOS, '9.0' 

Uncommenting the second line in your pod file will help you.

0
source

Source: https://habr.com/ru/post/1012328/


All Articles