1

Using Swift5 and Xcode-10.2.

After a Cocoapods install usage, I cannot import the Swift module - Why ???

And yes, there is plenty of posts out there that give ideas why. But none of them worked for me so far.

Here is my pod file:

project 'M.xcodeproj'
workspace 'MyApp.xcworkspace'
platform :ios, '11.0'
inhibit_all_warnings!

source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'

use_frameworks!

def shared_pods
  pod 'SwiftSVG'
end

target 'MyApp' do
    inherit! :search_paths
    shared_pods
end

t af

iKK
  • 6,394
  • 10
  • 58
  • 131
  • Have you tried cleaning the build folder? **SHIFT + COMMAND + K** – João Rocha Jul 02 '19 at 17:07
  • yes, I did that but nope - did not help... – iKK Jul 02 '19 at 17:47
  • Try to reinstall your pods by running this commands: `sudo gem install cocoapods-clean` `pod deintegrate` `pod clean` `pod install`, sometimes this solves some Pod's issues – João Rocha Jul 02 '19 at 17:52
  • I am not much further. However, I realised that one of my 7 Targets works. (most likely it did work all along). But what about the other 6 Targets. Why would another Xcode Target not compile and still show this silly message "module not found". Do you have any idea here ? (I have the same Framework Search Paths for all the 7 Targets). Is there any other parameter I need to set ? – iKK Jul 02 '19 at 18:03
  • Finally found it: The pod file did not have all the Targets - therefore the Header- and Framework Search Paths were not correct. – iKK Jul 02 '19 at 19:29

1 Answers1

-1

Silly me!

It turned out that my Podfile was missing Project-Targets:

project 'MyApp.xcodeproj'
workspace 'MyApp.xcworkspace'
platform :ios, '11.0'
inhibit_all_warnings!

source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'

use_frameworks!

def shared_pods
  # pod 'SVGKit'
  pod 'SwiftSVG'
end

target 'MyApp' do
    shared_pods
end

target 'MyApp Beta' do
    shared_pods
end

target 'MyApp Stage' do
    shared_pods
end

target 'MyApp Dev' do
    shared_pods
end

target 'MyApp DevPatch' do
    shared_pods
end

target 'MyApp Test2' do
    shared_pods
end

target 'MyApp TestPatch' do
    shared_pods
end

# target 'MyAppTests' do
#     shared_pods
# end

# target 'MyAppUITests' do
#     shared_pods
# end
iKK
  • 6,394
  • 10
  • 58
  • 131