Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build on device fails with exit code 1

Tags:

xcode

ios

iphone

I build an app successfully. After changing a bit, the build and run on simulator works still fine as expected, but the build and run with my physical device fails unexpected:

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Intermediates/WhagooAppFramework.build/Debug-iphoneos/WhagooAppFramework.build/Script-26D4B954E53A2CB72C219E1A.sh cd "/Users/oliverapel/Dropbox/WhaGoO/Project WhaGoO/App.iOS/development" /bin/sh -c /Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Intermediates/WhagooAppFramework.build/Debug-iphoneos/WhagooAppFramework.build/Script-26D4B954E53A2CB72C219E1A.sh

mkdir -p /Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Products/Debug-iphoneos/BerlinCapitalClub.app/Frameworks rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Products/Debug-iphoneos/Alamofire/Alamofire.framework" "/Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Products/Debug-iphoneos/BerlinCapitalClub.app/Frameworks" building file list ... done Alamofire.framework/

sent 147 bytes received 26 bytes 346.00 bytes/sec total size is 1073519 speedup is 6205.31 Code Signing /Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Products/Debug-iphoneos/BerlinCapitalClub.app/Frameworks/Alamofire.framework with Identity iPhone Developer: Oliver Apel (W65P7YG9ZK) /usr/bin/codesign --force --sign B68B8D50CF4B9D2517527291D6F3D051423B194F --preserve-metadata=identifier,entitlements "/Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Products/Debug-iphoneos/BerlinCapitalClub.app/Frameworks/Alamofire.framework" /Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Products/Debug-iphoneos/BerlinCapitalClub.app/Frameworks/Alamofire.framework: User canceled the operation. Command /bin/sh failed with exit code 1

In the last line I see user canceled the operation. but I do nothing like this.

I already cleaned build folder, removed derived data and now I don´t know what to do.

like image 700
Oliver Apel Avatar asked May 20 '17 11:05

Oliver Apel


3 Answers

lock add unlock keychain solve the problem, it' weird.

like image 198
responser Avatar answered Oct 19 '22 20:10

responser


Try updating Certificates from Preference -> Accounts -> Choose developer account and Proper Team -> View Details -> Download all profiles.

Also, try doing Deep clean using Cmd+Shift+Alt+K. Make sure you have selected correct developer team in your general settings.

Also, Change Provisioning to Automatic. So that it will automatically fetch proper certificates.

After that, Goto Build Phases ->Link Binary frameworks-> Add Frameworks you want. Do this for all targets that you have.

Try this and let me know if error still occurs.

Hope it helps..

like image 35
Balaji Ramakrishnan Avatar answered Oct 19 '22 18:10

Balaji Ramakrishnan


I just simply restarted my MacBook Pro. I found this solution here.

like image 42
Parth Patel Avatar answered Oct 19 '22 20:10

Parth Patel