简体   繁体   中英

How to use objectiveC and swift libraries Cocoa Pods

I'm currently using Swift for an Objective-C project. Previously, I imported those Objective-C frameworks through bridging header since I did not use any Swift pods. But today, I need to use swift libraries such as Alamofire, which means I will need to use_framework! in my Pod File.

However, here comes the problem, after I pod install, and try to run the project on my device, errors jump up! What is even more odds is that everything works fine on simulator.

The errors are mainly about "Cannot find XX module" / "Cannot find XX local file" in objectiveC files.

I think it must have something to do with "use_frameworks" in cocoa pods. My question is how can I solve this problem? A million thanks beforehand, I have been scratching my head for this the whole day!

Go to Window -> Projects and Delete derived data. Then do a standard rebuild and it should work fine. I have run into this a few times when dealing with changing cocoapods.

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