Cocoapods use_frameworks! import issue

北城以北 提交于 2019-11-30 08:21:11
Diego Freniche

As you've used Modules in your Podfile, why don't you just:

@import SSKeychain;

instead of:

#import <SSKeychain/SSKeychain.h>

To test that:

  • create a simple iOS project, just with one ViewController
  • create a Podfile using your code above
  • run pod install
  • open the Workspace
  • build & run: it compiles OK

I have finally figured out it! The problem was fixed by removing Pods.framework from Link Binary With Libraries and adding them again manually.

Thanks for help!

Also check error messages on pod install.

In my case I was using a custom import in FRAMEWORK_SEARCH_PATHS, and just because I was doing that, whenever I did pod install the extra search paths that CocoaPods adds were not being added. So I had to remove my custom path and then they showed up. Then I added my custom path.

Might be a good idea to do pod deintegrate, delete de xcworkspace file and do pod install once more. Then add your custom build settings.

This is the error I was getting:

[!] The App [Debug] target overrides the FRAMEWORK_SEARCH_PATHS
build setting defined in Pods/Target Support Files/Pods-AppLib/Pods-AppLib.debug.xcconfig. 
This can lead to problems with the CocoaPods installation

In my case, what was an issue I already downloaded few ObjC Pods for my Objective C Project then I need one swift pod so I enable use_framwork in my pod file and install that swift pod, After installing that swift pod import issue arrives for ObjeC Libraries in many classes, So

What I did to fix this issue?

  1. Cut all Objective C pods from pod file
  2. Open terminal and run command: cd path/myProject
  3. Terminal run command: pod install
  4. Past it (all Objective C pods) again in pod file and save it
  5. Terminal run command: pod install
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!