Daniel Pereira Daniel Pereira - 3 months ago 68
iOS Question

linker command failed with exit code 1 (use -v to see invocation) with cocoapods swift

I'm trying to compile my project in swift with cocoapods and I'm getting this error:

ld: warning: directory not found for option '-F/Users/platis/Library/Developer/Xcode/DerivedData/Platis-dazbrsqztcftsbapiewpxklnxdhp/Build/Products/Debug-iphonesimulator/ToastSwift'
ld: framework not found ToastSwift
clang: error: linker command failed with exit code 1 (use -v to see invocation)


I'm trying to install ToastSwift from this

Answer

When you use a CocoaPod, it creates a new launch file: Project.xcworkspace

Only this file contains the Pod configuration. Technically speaking a workspace is a collection of projects; each Pod gets its own project because every Pod has its own configuration requirements and resources. You can no longer use the .xcodeproj to launch your project, otherwise none of the Pod information will be found.

If you fail to do this, you'll get all manner of compile and link errors.

You missed this line of the docs:

https://guides.cocoapods.org/using/using-cocoapods.html

Open the MyApp.xcworkspace that was created. This should be the file you use everyday to create your app.