xtrinch
xtrinch

Reputation: 2281

'Swift is not supported for static libraries' when creating a CocoaPod

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?

Upvotes: 9

Views: 4922

Answers (3)

Samira
Samira

Reputation: 874

open project.xcworkspace file instead of project.xcodeproj

Upvotes: 0

xtrinch
xtrinch

Reputation: 2281

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.

Upvotes: 19

Rikh
Rikh

Reputation: 4222

I have run into a similar issue before. It is an issue with use_frameworks! that breaks for pods that have dependencies with static libraries.

Only solution for this that i found, after searching for quite a long while, was to remove all pods that use static binaries and try and find alternatives with dynamic frameworks.

Upvotes: 1

Related Questions