Trying to archive my build gives a PhaseScriptExecution error - ios

I can't archive my build it gives the next errorCommand:
PhaseScriptExecution failed with a nonzero exit code
I am not able to run the build in device while run using the provision profile. Is the issue related to a provision profile?
I've tried to reinstall all pods, but still I can't archive a build successfully.

Related

flutter Xcode error Command PhaseScriptExecution failed with a nonzero exit code

After I integrated the flutter project into the iOS project, I have to 'clean' it with Xcode every time I run the iOS project, otherwise it will report an error. Error content:
Command PhaseScriptExecution failed with a nonzero exit code
you have to apply or set a minimum deployment target in Xcode or in your project. Xcode will show you a recommended update while building the project just click on it and apply to perform changes and it will automatically change in necessary files

Xcode 11.6 Command PhaseScriptExecution failed with a nonzero exit code

I'm trying to Archive my build in Xcode 11.6 running on macOS 10.15.5 and every time I get the same error "Command PhaseScriptExecution failed with a nonzero exit code".
In Signing & Capabilities option I've chosen Distribution provisioning profile on both tabs Debug and Release and I've disabled automatic signing.
I have 2 certificates: one for development and one for distribution.
Here is the error:
I've already tried Keychain lock and unlock. On Xcode 10 and macOS 10.14 this worked without any problems.
Can you help me please,
Robert
According to the error message, it seems there is a build script that tries to run another script called copy-www-build-step.sh, and gets a "Permission Denied" error. The most likely cause is simply that the script file does not have execute permissions (no files have this permission by default, and permissions are often lost when e.g. unzipping an archive).
This can be easily solved by running the following command in Terminal to enable execute permissions:
chmod +x /path/to/copy-www-build-step.sh

Command PhaseScriptExecution failed with a nonzero exit code Xcode 11.4

I am trying to build an archive for my flutter app on Xcode, bt I do not know why I kept getting this error.
Command PhaseScriptExecution failed with a nonzero exit code
I have my project migrated using the manual migration guildlines for the Xcode 11.4 version. My project runs well on the simulator though but I cannot build the .ipa archive file.
Logs
/Users/apple/Library/Developer/Xcode/DerivedData/Runner-acigcqmznpynacbcdnfflfigyoxx/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/Kashbase .app/Frameworks/Flutter.framework/Flutter: errSecInternalComponent
Non-fat binary /Users/apple/Library/Developer/Xcode/DerivedData/Runner-acigcqmznpynacbcdnfflfigyoxx/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications//Kashbase .app/Frameworks/App.framework/App is not armv7. Running lipo -info:
Non-fat file: /Users/apple/Library/Developer/Xcode/DerivedData/Runner-acigcqmznpynacbcdnfflfigyoxx/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications//Kashbase .app/Frameworks/App.framework/App is architecture: x86_64
Command /bin/sh failed with exit code 1
Try this workaround:
Go to
Keychain Access -> Right-click on login -> Lock & unlock again
Xcode -> Clean Xcode project -> Make build again
Keychain Access
is a program in your Mac in Utilities. Cmd Tab keychain Access to find
it.
You can also try other solutions here if the workaround mentioned above is not working.

Jenkins jobs not working after revoking Distribution certificate in Remote Machine

I have been facing an issue with Jenkins in building my iOS jobs. Recently our distribution certificate has been expired and we have revoked it and imported the same cert into Remote Machine. Since that moment my jenkins jobs are failing at the compile stage itself. Below is the error i'm getting from jenkins console.
/Users/jenkins/Library/Developer/Xcode/DerivedData/Companion-
dtiiwydzoavsrybgsztwqribsxtx/Build/Products/Release-
iphoneos/sample.app/Frameworks/KSCrash.framework:
errSecInternalComponent
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks
/Users/jenkins/Library/Developer/Xcode/DerivedData/Companion-
dtiiwydzoavsrybgsztwqribsxtx/Build/Intermediates.noindex/
Companion.build/Release-
iphoneos/SampleProject.build/Script-15FB268A228A7C3900925F65.sh
Do i need to add that new certificate some where else ? What might be the issue ? Any help is appreciated.
This has solved my problem https://stackoverflow.com/a/52221673/1025976.
Solution for errSecInternalComponent error is : Go to Keychain -> My Certificates -> Select your Development or Distribution certficiate -> Expand it and double click on the private key -> Select "Allow all applications to access them" and save changes. This should solve the problem.

Ionic run fail to deploy to device

I am using Mac OS X 10.11. I am trying to deploy build to device (iPhone 4) by running sudo ionic run ios --device and I get this error message:
Check dependencies
Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) were found.
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/john/Desktop/Myproject/platforms/ios/cordova/build-debug.xcconfig,-project,Myproject.xcodeproj,ARCHS=armv7 armv7s arm64,-target,Myproject,-configuration,Debug,-sdk,iphoneos,build,VALID_ARCHS=armv7 armv7s arm64,CONFIGURATION_BUILD_DIR=/Users/john/Desktop/Myproject/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/john/Desktop/Myproject/platforms/ios/build/sharedpch
ERROR running one or more of the platforms: Error: /Users/john/Desktop/Myproject/platforms/ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project
I have no problem when running just only ionic run ios, which will deploy the app into emulator. How can I overcome the problem?
Another method will be
Go to your platform directory of your project /platforms/ios
Write in the console open . which will open your folder with Finder.
After that open YourProject.xcodeproj with XCode and select your device and click on run.
Good luck

Resources