简体   繁体   中英

Build time error swift 4 xCode 9 with Alamofire added in pod

I was working on a project which I required to updated to support Swift 4. After making related changes, When I have run the application I got the similar error mentioned below. After which I have created a new and empty project to check which also encountered the same error.

What did I do?

Initially, I have created a project in xCode 9 with Swift 4 and add Alamofire in pod file and run the code without making any change in code.

What happened instead?

Instead of building successful, It shows an error:

PhaseScriptExecution \[CP\]\ Embed\ Pods\ Frameworks /Users/rigel/Library/Developer/Xcode/DerivedData/xCode9Demo-fhmuhhcblhavqddwdzduqcfflaqu/Build/Intermediates.noindex/xCode9Demo.build/Debug-iphonesimulator/xCode9Demo.build/Script-2DACA56F3034C685ED1342BD.sh
    cd /Users/rigel/Vihar/Development/Demo/Created/xCode9Demo
    /bin/sh -c /Users/rigel/Library/Developer/Xcode/DerivedData/xCode9Demo-fhmuhhcblhavqddwdzduqcfflaqu/Build/Intermediates.noindex/xCode9Demo.build/Debug-iphonesimulator/xCode9Demo.build/Script-2DACA56F3034C685ED1342BD.sh

mkdir -p /Users/rigel/Library/Developer/Xcode/DerivedData/xCode9Demo-fhmuhhcblhavqddwdzduqcfflaqu/Build/Products/Debug-iphonesimulator/xCode9Demo.app/Frameworks
rsync --delete -av --filter P .*.?????? --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/rigel/Library/Developer/Xcode/DerivedData/xCode9Demo-fhmuhhcblhavqddwdzduqcfflaqu/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework" "/Users/rigel/Library/Developer/Xcode/DerivedData/xCode9Demo-fhmuhhcblhavqddwdzduqcfflaqu/Build/Products/Debug-iphonesimulator/xCode9Demo.app/Frameworks"
building file list ... done
Alamofire.framework/
Alamofire.framework/Alamofire
Alamofire.framework/Info.plist
Alamofire.framework/_CodeSignature/
Alamofire.framework/_CodeSignature/CodeResources

sent 1730891 bytes  received 98 bytes  3461978.00 bytes/sec
total size is 1730337  speedup is 1.00
basename: invalid option -- 's'
Try `basename --help' for more information.
Command /bin/sh failed with exit code 1

Alamofire Environment

Alamofire version: 4.5.0
Xcode version: 9_GM(Beta)
Swift version: 4.0
Platform(s) running Alamofire: iOS 10.3.3
macOS version running Xcode: 10.12.6

Anyone can please help me?

I would suggest to use Alamofire 4.5.1

Add the following line to have Alamofire in pod file, which was built on Swift 4 and then perform pod install.

pod 'Alamofire', '4.5.1'

I tried it on Mac OS 10.12.6, Xcode 9 & Swift 4.

I hope it would be work around until the version 4.5.1 officially available. So, we can stop mentioning version in the pod file.

After spending good amount of time on the surfing, I come to know that the issue is related to the configurations, mostly hardware configurations of a MAC I was using.
Once I have tried running the same code on another mac it works perfectly.
This could not be the solution for all which I know but I have shared my scenario because if someone stuck in such an issue and even after spending a good amount of time like me, don't get any solution I suggest please check running the code in another MAC .
I have to spend a really good amount of time on the issue, which I wish other must not.

I hope you don't have the issue but might got help from this So please don't lead the answer in any negative direction if this will not be your answer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM