Can't archive with Xcode (error - PhaseScriptExecution failed with a non zero exit code), but the build is successful - ios

I am sorry for the black marks in the image.
I have seen multiple posts suggesting an answer to this problem, Lock unlocks keychain (tried it), pod Update (tried it), clear build(tried it), signing, skip install in build settings(tried it) - None of them actually worked.
I built my iOS app in react native with Expo, after which I did expo eject to create the iOS folder for Xcode build and archiving, the build is successful every time and it even runs on the simulator and in my device(iPhone 7) but it always failed to archive by throwing this error - Uncategorised - Command PhaseScriptExecution failed with a non zero exit code..
Any help to point me in which direction should I go or what can be the possible mistake that I am doing will be of great help. Do let me know if, I should provide any more detail about this. Thank you!
Xcode Version - 11.0
Mac Version - 10.15 Catalina
iPhone OS - 13.1.3
Few links I tried from -
"${PODS_ROOT}/SwiftLint/swiftlint" causes "Command PhaseScriptExecution failed with a nonzero exit code" with Xcode 10
https://github.com/apollographql/apollo-ios/issues/395
https://www.reddit.com/r/iOSProgramming/comments/al9box/getting_an_error_command_phasescriptexecution/

Make sure you have installed your pods correctly. For me I removed all the pods from my pod file, updated the pod through the terminal, then re-added the pods to the pod file and installed through the terminal. This worked perfectly for me.

I had the same exact problem. What worked for me was I opened the podifle and deleted all the pods, then saved it. After that run pod update in terminal. Go back to the podfile and past the pods back into the file and save it. Then run pod update in terminal again. After that open xcode and run the cleaner and then try to Archive...it worked for me.

Based on the previous answers, the following worked for me:
Quit XCode.
Delete all relevant files: Podfile, Podfile.lok, Pods folder and .workspace file.
Recreate the Podfile and open the new .workspace file.
Cheers
PS: In my case, I hit this issue after copying an existing project (workspace) to a new machine.

Try go to accounts and press download manual profilesenter image description here

Related

Xcode 14.0 Command PhaseScriptExecution failed

After updating Xcode to 14.0 (and accompanying Xcode Command Line Tools), and building my application as I normally would, I'm running into the error you see above. This is a pretty well documented error, but I've tried every solution I've been able to find:
Investigating Keychain settings
Running pod deintegrate and pod install
Cleaning the build folder
Logging off and shutting everything down and turning things back on / logging back in
Entering arm64 as an excluded architecture and subsequently removing it from the .xcworkspace
Combinations of all the above
Ensuring all the Pods I have are not out of date.
I'm at a loss. Your input is greatly appreciated. Thank you.
As it turns out, there was a file generated as part of the build process (I don't know exactly what) with some flag set that I didn't think I needed, so I just deleted it and rebuilt the app. No issues there.
Solution: it helps to comb through staged commits to see if there's anything created that simply isn't needed, and to delete those files ad hoc.

importing "Module 'app_settings'" not found

I'm currently trying to work with xcode to test my flutter application with xcode. The big issue is that all of my imports (such as app_settings, cloud_firestore, etc...) give an error for "Module ___ not found". When I try to run my dart code I get the error in the terminal:
[Proj Root]/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'app_settings' not found
#import app_settings;
~~~~~~~~^~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
I tried running flutter create for ios, (this might've made things worse?) Flutter clean and reinstalling pods doesn't seem to work either. I'm wondering if there's something simple that I missed with importing modules. I created the application on android using modules that should work with Android & iOS. After getting the android version working I pulled my project on my mac through github and finally reached this issue. Any pointers would be appreciated because I'm totally stuck on this.
My project has 3 build flavor. Development, Staging & Production.
In Xcode It was selected default Runner One. (On Top of the middle)
though i follow the process like
delete pod , Podfile.lock and .symlinks from Android Studio / (From Project)
flutter pub get
cd ios > pod install
Then In XCode > clean build
Select Right Build Flavor (Production For Me)
Then Archive (Done)
NB: I tested in M1 machine.
Hmm Not sure what happened but it seems to be good now. I think pod init was initializing minimal data for the podfile. Instead, I deleted the Pods file and did flutter run and it built the podfile correctly with flutter pub get.
Had the same problem, we solved it by setting the iOS Deployment target in XCode to the same value as set in the Podfile, which was 12.0. Then ran flutter clean and flutter build ios worked like a charm 🎉
I had this same problem. What I did was
Delete the Podfile and Podfile.lock
flutter clean
flutter build ios
Opened the Runner.xcworkspace
Build on Xcode
This worked for me 🎉
Delete pod directory and podfile.lock
flutter clean
flutter pub get
cd ios
pod install --repo-update
run the application in Xcode
I tried everything above, but for me the solution was quite different.
I am using flavors (schemes), and I accidentally created the scheme with upper case in the first character, while everywhere else (build config etc.) I used lower cases only. After deleting the scheme and recreating with lower case characters, it worked.
path/flutter/ios/Runner/GeneratedPluginRegistrant.m:12:9: Module 'app_settings' not found
I had the same issue after upgrading the Xcode to 13.3 and my production build flavor wasn't working. I was using firebase as well. In my production build flavor, I didn't append anything to the configuration name (i.e. all the other configurations have the name like "Debug-staging", "Debug-development", but in the production, it's only "Debug"). I just deleted the pod file and run:
flutter run --flavor production --target lib/main_production.dart
Everything worked fine for me.

Flutter App can't run on IoS simulator with cycle inside runner, and domain=NSPOSIXErrorDomain, code=63

I am having problems since the IoS 14 update. At first it was the deployment target 8.0 and it could temporalily fixed by updating GoogleInfoPlist every time I pulled from our repo in Git. but after a while this temporary fix doesn't work anymore. I got header problem for my FlutterFire plugins.
warning: double-quoted include "FLTFirebaseCorePlugin.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header]
#import "FLTFirebaseCorePlugin.h"
^~~~~~~~~~~~~~~~~~~~~~~~~
<firebase_core/FLTFirebaseCorePlugin.h>
I have updated my deprecated Firebase core,auth and firestore plugin to the newest one with the help of the flutterfire migration guide. after that the firebase plugin problem was fixed. but i still got problems with 2 plugins: Google Maps Flutter and Image Picker. Waht i did to fix the problem was updating Cocoapods to the beta version for the Google Maps plugin but ther was still a problem with the image picker for the moment i deleted the plugin form my app.
After that i got 3 errors. the first one is the CodeSign cycle inside Runner Error :
error: Cycle inside Runner; building could produce unreliable results.Target 'Runner': CodeSign /Users/user/StudioProjects/app/build/ios/Debug-iphonesimulator/Runner.app
â—‹ Target 'Runner' has copy command from '/Users/vaisatriani/StudioProjects/kuliner_11_app/build/ios/Debug-iphonesimulator/Runner.app' to
I searched for a fix and i found that flutter clean can fix that error. The error did go away but one new error popped out :
error: '/Users/Username/StudioProjects/appname/build/ios/Debug-iphonesimulator/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/GoogleService-Info.plist' is longer than filepath buffer size (1025). (in target 'Runner' from project 'Runner')
And i somehow fixed it by removing Runner as Target from Product in XCode. but now i'm stuck with this one error.
Unable to install /Users/user/StudioProjects/app/build/ios/iphonesimulator/Runner.app on FFF556AF-19DB-4B7B-93BF-A67EE0EA8621. This is sometimes caused by a malformed plist file:
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=63):
copyfile of file:///Users/user/StudioProjects/app/build/ios/iphonesimulator/Runner.app/ to file:///Users/user/Library/Developer/CoreSimulator/Devices/FFF556AF-19DB-4B7B-93BF-A67EE0EA8621/data/Containers/Shared/SystemGroup/systemgroup.com.apple.installcoordinationd/Library/InstallCoordination/PromiseStaging/EF2DB4B2-5512-4C14-BCA3-FA7667170000/Runner.app failed: File name too long
Unhandled error domain NSPOSIXErrorDomain, code 63
Command: /usr/bin/xcrun simctl install FFF556AF-19DB-4B7B-93BF-A67EE0EA8621 /Users/user/StudioProjects/app/build/ios/iphonesimulator/Runner.app
I couldn't fix it by deleting Derived Data. Does somebody knows how to fix this?? i'm stuck with this problem for a while now. Any help would be appreciated. Thank you so much.
Found a fix for this error. what i did was to reset the simulator (Device -> Erase All Content and Settings), and then run $ flutter clean after that rebuild your app.
delete → Runner.xcworkspace → xcuserdata folder
delete → Pods folder on inside ios folder
delete → ios → flutter → Flutter.podspec
run flutter clean
flutter run

Xcode 8.3 Archive error: Linker command failed with exit code 1

I started getting this error only after upgrading from Xcode 8.2 to Xcode 8.3, and only when making an archive build (debug builds work fine).
When I do the archive via Xcode, the only message I get is "Linker command failed with exit code 1 (use -v to see invocation).
I build with the command line xcodebuild -scheme MyProduct
When I built this way, I found a number of issues (again, only when doing Archive):
I had to add import UIKit to practically every swift file.
all the pods had issues
remove everything from app-Bridging-Header.h
add a few things back into app-Bridging-Header.h
My current issue is with the AWS pod, using version 2.5.3
So my app-Bridging-Header.h has #import <AWSS3/AWSS3.h>
Here is the error from the command line build:
error: 'AWSS3/AWSS3.h' file not found with <angled> include; use "quotes" instead
#import <AWSS3/AWSS3.h>
^
The error log continues after that. I also tried the crazy suggestion of switch in the import to "AWSS3/AWSS3.h"...that didn't work either.
What is going on?
More INFO
This really appears to be an issue with one of my pods. I built a new solution, imported a subset of my pods and everything built. Then when I updated with the full list of pods it broke.
For me it is coming due to Bitcode enable in my project and i have used a custom framework with disabled bitcode.
Two things you can do :
Either disable bitcode in your project
OR
Build framework with bitcode enable
NOTE: If you click on error and it doesn't show anything then right click on error and select Reveal in Log. You will get error for this issue
At long last I was able to figure out this was a pod issue...just had to figure out which one it was.
I created a brand new project and started adding my pods in one by one (actually, 3 by 3...one by one would have taken too long).
Conclusion: localytics 4.3.1 has a bug in it somewhere. I downgraded to 4.3.0 and the problem went away.
I got a problem like this. My suggestion is that you should remove the version of 8.3 and download any old version from this link: https://developer.apple.com/download/more/
I hope that it will work.

Command /bin/sh failed with exit code 1 and Embedded pods framework

Not able to identified actual issue, During updating coco pod getting a message "Re-creating CocoaPods due to major version update."
(that was come only once) and pod updation is successful. After on build i am getting the error. Command /bin/sh failed with exit code 1.
Below is some detail also which i am getting
Code Signing /Users/Gaurav/Library/Developer/Xcode/DerivedData/Appname-******/Build/Products/Debug-iphoneos/Appname.app/Frameworks/Alamofire.framework with Identity iPhone Developer: Account Name (Account Id)
/usr/bin/codesign --force --sign ***************** --preserve-metadata=identifier,entitlements "/Users/UserName/Library/Developer/Xcode/DerivedData/Appname-***************/Build/Products/Debug-iphoneos/Appname.app/Frameworks/Alamofire.framework"
/Users/Username/Library/Developer/Xcode/DerivedData/Appname-************/Build/Products/Debug-iphoneos/Appname.app/Frameworks/Alamofire.framework: bundle format unrecognized, invalid, or unsuitable
I'm using iOS 8 as deployment target and Xcode 7.3.1
I have checked code signing identity that doesn't have any issue. I have reinstall again all pod and Alamofire also but not abel to identified issue.
Clean the project, and deleting the derived data (~/Library/Developer/Xcode/DerivedData/) fixed it for me
If it was complaining about a particular Pod and being unable to codesign it.
Below things work for me:
Select the Pods Project In the main editor window, select the Pod in
the targets dropdown
Under the general tab, and under the identity header, click choose
Info.plist file
Select the plist file for the Pod
The project should now build. For some reason, it seems to lose this setting, or not be able to reference it's own plist file.
Not 100% sure but I hope it helps someone.
I have the same issue. It happen after updating cocoaPods, so I just downgrading it and all works fine. I think we just need to wait for a new version of cocoaPods and for now you can use old version.
How to downgrade cocoaPods

Resources