I created a skeleton pod with pod lib create
and I am writing my code into the Development pods > MyPod > Classes
group.
I am getting the error Swift is not supported for static libraries
.
I haven't really edited any of the other files besides replaced the ReplaceMe.swift and added some others.
Here's the podfile:
use_frameworks!
target 'MyPod_Example' do
pod 'MyPod', :path => '../'
target 'MyPod_Tests' do
inherit! :search_paths
end
end
What am I missing?
As mentioned, Apple does allow Swift in static libraries as of Xcode 9 Beta 4.
Implement the podIn the project navigator, right click on the SwiftyLab target and select New File... Choose Swift File as the new file template, click on Next … Name the file as SwiftyLib , make sure this file belongs to the SwiftyLib target and save it in the SwiftyLib folder as shown in the screenshot below.
CocoaPods pod-linkage plugin. In SwiftKey, we have a dynamic framework that we use to share code between the app and the keyboard extension, and all the pods are linked statically except for some of them that are linked dynamically because they are linked to the app and keyboard extension too.
To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.)
Turns out I should have read the tutorial better, it clearly says this:
[!] Note: Due to a Development Pods implementation detail, when you add new/existing files to Pod/Classes or Pod/Assets or update your podspec, you should run pod install or pod update.
It helped with the very uninformative error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With