简体   繁体   中英

Swift Framework Added via Cocoapods into Objective-C App - "Module not found"

In Xcode 8 I'm having trouble importing any Swift 2.3 or 3 framework that was added with Cocoapods into my project.

There is a public umbrella.h file, but for some reason Xcode can't find the framework when I try to @import it.

As an example, create any Objective-C project, use the following Podfile, pod install, and then try the @import . It asks me to update the code to swift 2.3 or 3 even if that code is already Swift 2.3 or Swift 3 code. I've cleaned and tried to rebuild as well.

platform :ios, '8.0'
use_frameworks!

target 'testingFrameworks' do
  pod 'SwiftyJSON'
end

Did I miss a step?

I used socketIO and was having the same problem. My solution to this is:

  1. Close project.
  2. Delete pod files, delivered files, pod framework, workspace file (clean up project)
  3. pod install
  4. Reopen workspace, upgrade swift syntax if xcode ask for, build a few times.

You might need to fix something for the new swift.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM