最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

swift - Why does adding Alamofire with SPM result in a "no such file or directory" error? - Stack Overflow

programmeradmin1浏览0评论

I decided to create a small simple chat app to get familiar with certain API responses and how to use Alamofire package since I've never used that library, and also new to this particular API (TLDR brand new project with only Alamofire added in)

I keep getting an error when I do """ no such file or directory: '/Users/user/Library/Developer/Xcode/DerivedData/SimpleChatTest-evmpbefwjoqpnbarsdqlcjjcwxzu/Build/Products/Debug-iphoneos/PackageFrameworks/AlamofireDynamic.framework/AlamofireDynamic' """

I tried all the usual suspects with cleaning and rebuilding project, removing and re-adding the package, deleting derived data and rebuilding, nothing. Finally after banging my head against the problem for a while I ran into another thread on here that suggested removing the dynamic library of Alamofire. I have no idea what that library is in the first place or if I would need it, so I decided to do that and, voila.

So I guess my questions are, is this a common enough thing that everyone knows to just remove the dynamic? If that is the case why hasn't it been fixed? Is there something in the way that I added the library with Swift Package Manager?

I decided to create a small simple chat app to get familiar with certain API responses and how to use Alamofire package since I've never used that library, and also new to this particular API (TLDR brand new project with only Alamofire added in)

I keep getting an error when I do """ no such file or directory: '/Users/user/Library/Developer/Xcode/DerivedData/SimpleChatTest-evmpbefwjoqpnbarsdqlcjjcwxzu/Build/Products/Debug-iphoneos/PackageFrameworks/AlamofireDynamic.framework/AlamofireDynamic' """

I tried all the usual suspects with cleaning and rebuilding project, removing and re-adding the package, deleting derived data and rebuilding, nothing. Finally after banging my head against the problem for a while I ran into another thread on here that suggested removing the dynamic library of Alamofire. I have no idea what that library is in the first place or if I would need it, so I decided to do that and, voila.

So I guess my questions are, is this a common enough thing that everyone knows to just remove the dynamic? If that is the case why hasn't it been fixed? Is there something in the way that I added the library with Swift Package Manager?

Share Improve this question asked yesterday MiguelMiguel 111 bronze badge New contributor Miguel is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. 1
  • Actually you should just don't select dynamic when adding your package. – Leo Dabus Commented yesterday
Add a comment  | 

1 Answer 1

Reset to default 0

It seems like you have linked against both Alamofire and AlamofireDynamic. You should only linked against one of them. These are exactly the same library.

The purpose of AlamofireDynamic is to force Xcode to dynamically link the library. See the PR that added it. If you link against Alamofire, Xcode will automatically choose between static and dynamically, and it seems like it prefers static linking most of the time.

发布评论

评论列表(0)

  1. 暂无评论