iosswiftxcodedependenciesswift-package-manager

Cannot build app on real device due to Alamofire Dynamic


I am receiving this error when trying to build my project on a real device, when I build it on a simulator it works without any issue.

No such file or directory: '/Xcode/DerivedData/ProjectName/Build/Products/Debug-iphoneos/PackageFrameworks/AlamofireDynamic.framework/AlamofireDynamic'

I checked derived data on the simulator folder and it seems that it's different from the real device. Also what is this Alamofire Dynamic? I searched and cannot seem to find and answer if I remove Alamofire from my project it will build but it will crash giving me the same error as the one above but for Alamofire not Alamofire Dynamic, I tried clean build folder, reinstalling Alamofire, restart Xcode, pretty much everything that I could find online but nothing seems to work. Any help would be appreciated thanks! Forgot to mention that I am using SPM.


Solution

  • Remove the Alamofire package, clean the project using cmd + shift + k, and then add the package again using "Exact Version". I had success adding specifically version 5.8.1.