library not found for -lPods-AFNetworking

前端 未结 7 2020
忘了有多久
忘了有多久 2021-01-01 16:15

I am getting the following error when using AFNetworking:

\'\'library not found for -lPods-AFNetworking\'\'
\"linker co

相关标签:
7条回答
  • 2021-01-01 16:23

    In iWatch App using Cocoa Pods AFNetworking i got the Same issue.

    I Just Solved Issue ....

    Just Follow this Step.

    [1] Open your project's podfile by typing in terminal:

    open -a Xcode Podfile
    

    Check If you are Using AFNetworking than using

    source 'https://github.com/CocoaPods/Specs.git'
    platform :ios, '8.0'
    
    pod 'AFNetworking', '~> 3.0'
    

    copy and paste this between target 'iChat' do .... end

    Like .....

    target 'iChat' do
      # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
      # use_frameworks!
    
      # Pods for iChat
    
    source 'https://github.com/CocoaPods/Specs.git'
    platform :ios, '8.0'
    
    pod 'AFNetworking', '~> 3.0'
    
    end
    

    and

    [2] Then open your terminal again simply paste it.

    pod install
    

    Now open App.xcworkspace and Clear and Run You can see Error is Gone Now...

    0 讨论(0)
  • 2021-01-01 16:27

    Instead of opening the XCode project, you should open up the WorkSpace file.

    0 讨论(0)
  • 2021-01-01 16:31

    It has been a while since this question but today I ran into a similar issue and how we solved it was by going to: Edit Scheme > Build

    and making sure the option ´Find Implicit Dependencies´ is checked.

    I had it unchecked and after I updated CocoaPods to 1.0, I couldn´t find the dependencies in the Derived Data folder.

    After that I could build it succesfully.

    0 讨论(0)
  • 2021-01-01 16:31

    React native:

    I forgot to install a new RN module after pulling changes. So don't forget to npm i or yarn before building with react-native.

    0 讨论(0)
  • 2021-01-01 16:37

    I was facing the same problem and following solution worked for me:

    1. Go to project setting -> build setting -> other linker flag, and remove all flags that have -lpod or frameworks or related to pods. Don't remove the required flags (e.g. -ObjC, -licucore, -libxml2)
    2. Add a flag $(inherited) at the top.
    3. Clean the project and compile.
    0 讨论(0)
  • 2021-01-01 16:39

    I wanted to write an answer myself because two things together worked :

    1. AS @Helium3 mentioned, I had to open the workspace rather than the project file in the file explorer(projectname.xcworkspace file)(I actually have 2 and only 1 seems to work!)

    2. As @Muhammad Adnan mentioned in the comments, what worked was to install pod and update pod it solved the linker problems!!(Note: This should be done in the project directory,make sure cocoapods are installed first!!), in addition it gave me odd errors at first(after a second go),later it was alright!

    Thank you guys!

    0 讨论(0)
提交回复
热议问题