Xcode clang error when adding SDWebImage infrastructure

I am trying to compile an application using SDWebImage, when I add the framework to xCode, I keep getting the following error.

I tried adding a framework by cloning git repo

ld: framework not found SDWebImage clang: error: linker command failed with exit code 1 (use -v to see invocation) 

enter image description here

0
source share
2 answers

Linking in Xcode takes a bit of work. We can say what to do or offer the best way. Since I think the dropping framework solution is a very bad habit, I highly recommend the best way:

Use the dependency manager!

This will help you see when your dependencies receive new updates. You also know which version you are using. This is a good practice.

You can, for example, use Cocoapods . Go to your terminal, enter:

 $ sudo gem install cocoapods 

Then go to the project folder (the place where you have xcodeproj ) and type:

 $ pod init 

Creates a file called Podfile . Open it and paste:

 platform :ios, '8.0' // or whatever you need use_frameworks! pod 'SDWebImage', '~> 3.7' 

So, when you are ready, open the "Terminal" and enter:

 $ pod install 

You should now be working on xcworkspace instead of od xcodeproj . Your addiction should work correctly.

By the way: There are many other solutions. You can just use git submodules . You can also use Carthage . However, the most popular and most convenient way for me is Cocoapods , so I wrote the steps for this path.

+1
source

You have added SDWebImage as a related structure.

What you should do is add it as a built-in framework and make sure that the build phase copies the structure to your application package.

0
source

All Articles