swiftalamofirexcode10

Xcode error Alamofire.framework: No such file or directory


I've been stuck on this problem since yesterday morning and I don't know what else to try. I am using Xcode 10, Swift 4.

Everything was ok, until I tried to use a real iPhone to test my app.

I needed to login on Mac id and I realized I created a kind of new certificate (I am new at it and I don’t know why is that). I realized also there was another expired certificate on key chain access that I deleted (from the previous developer).

I tried to run on the iPhone, Xcode asked me about keychain password, I tried to put the password from my Mac id and it wasn’t it. So I declined. All my problems started then.

First error was:

Command /bin/sh failed with exit code 1

So I tried to check “Run Script Only When Installing” at Build Phases.

The error changed to:

libswiftcore :-1: Failed with exit code 1

I tried to reset my password from keychain, unlock and lock it, but no success. Tried also to clean project, move to trash all DerivedData.

I tried to restart macbook and xcode also.

So I decided to update Xcode from 9.4 to 10.

Tried again, same error.

Ok, I gave up, I decided to use only simulators then.

I got a new error: `

dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire

So, I tried to add Alamofire framework at Target, Build Phases, Embedded Frameworks.

Every time I tried something different, I tried do clean project, build and run. Also restarting xcode, locking and unlocking keychain.

New and current error:

Copy Alamofire.framework 0.1 seconds
PBXCp /Users/myfolder/Library/Developer/Xcode/DerivedData/AppZap-epwtpkbsxrklbvdulvpzvgvgswoh/Build/Products/Debug-iphonesimulator/Alamofire.framework /Users/zapgrafica/Library/Developer/Xcode/DerivedData/AppZap-epwtpkbsxrklbvdulvpzvgvgswoh/Build/Products/Debug-iphonesimulator/AppZap.app/Frameworks/Alamofire.framework
    cd /Projetos/Mobile/Ios/trunk/AppZap
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -exclude Headers -exclude PrivateHeaders -exclude Modules -exclude *.tbd -resolve-src-symlinks /Users/zapgrafica/Library/Developer/Xcode/DerivedData/AppZap-epwtpkbsxrklbvdulvpzvgvgswoh/Build/Products/Debug-iphonesimulator/Alamofire.framework /Users/zapgrafica/Library/Developer/Xcode/DerivedData/AppZap-epwtpkbsxrklbvdulvpzvgvgswoh/Build/Products/Debug-iphonesimulator/AppZap.app/Frameworks

error: /Users/myfolder/Library/Developer/Xcode/DerivedData/AppZap-epwtpkbsxrklbvdulvpzvgvgswoh/Build/Products/Debug-iphonesimulator/Alamofire.framework: No such file or directory

I have tried to uninstall pod, install and update. I tried to clean DerivedData also.

I am opening .xcworkspace not the .xcodeproj.

I have read almost 100 questions and answers from here.

The only thing I realized is that since the first time I declined keychain, I have never gotten the box from keychain with “Always Allow, Decline and Allow” anymore.

Could anyone help me please?


Solution

  • UPDATED

    I used to have the same problem, yet didn't understood why it happened. As far as I know is a problem with your keychain. Try removing the certificate, change the bundle identifier and try it again.

    mixed with your solution

    Then, clean and run.