After updating to Xcode 13.3.1 and updating comand line tools I cannot build my project. I get error:
Command PhaseScriptExecution failed with a nonzero exit code
python -mjson.tool ./someFileName.json
xargs: python: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
The script that failes is:
python -mjson.tool "${TARGET_BUILD_DIR}/${WRAPPER_NAME}/assets/someFileName.json"
It was working fine before. Even if I checkout at the commit that was working I still get the same message. This is why I suspect Xcode update.
Does anyone know how to solve this? What does the error mean? What does No such file or directory refer to? Is Python missing (cannot be found)? what is mjson.tool and is it missing? Is someFileName.json missing?
Any help is appreciated :)
Let me answer my own question here :)
MacOS 12.3.1 Monterey dropped support for Python 2 and it is removed from the OS. That is what
xargs: python: No such file or directory
was trying to say to me - python is missing. Fortunately Python 3 is installed and you can access it by calling python3 instead of just python.
Be ware because python2 code is not always runnable on Python3. Chances are you will need to fix (update) the code.
I was lucky and I managed to fix this just by replacing python with python3.
Alternatively you could try to install python2 by hand but this is not recommended.
So I'm needing to install SwiftLint for a project and I installed it as an SPM package from their repo here: https://github.com/realm/SwiftLint.
Shortly after installing it, I go to build the project and get this error:
/Users/MyUser/Library/Developer/Xcode/DerivedData/Project-caihxbhbecuvjfdnnwkmygqurxhn/Build/Intermediates.noindex/Project.build/Debug-iphonesimulator/Project.build/Script-89127C271F8EAAD2009335C8.sh: line 2: /SwiftLint/swiftlint: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
I'm not very experienced with Packages so this is all new to me but I can't seem to find any documentation on this particular error, or if there is something else I'm missing in the installation. I've tried removing and reinstalling the package, deleting DerivedData and cleaning the build in every combination/order you can think of. Currently running Xcode 13.2.1 and a target of iOS 14.1.
I am getting Error while running Project:
file:///Users/AVC/Documents/Simon%20Projects/DemoApp/bin/xcodeproj-checker-config-permissive.yml
ln: /Users/AVC/Documents/Simon Projects/DemoApp/.git/hooks/pre-commit: File exists
Command PhaseScriptExecution failed with a nonzero exit code
My XCode Version: 13.0
Swift Vdersion: 4.2
Tried lot of ways But cant find solution.
Remove .git/hooks/pre-commit
That is just a alias and the original file can not be created due to this. script creates new pre-commit file and it's alias at run time.
I'm making an app on flutter, but for some reason when i try to build my app and run it on my device i'm getting this error below.
/bin/sh: /Users/maps/Desktop/flutter/bin/packages/flutter_tools/bin/xcode_backend.sh: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
I tried to:
Update sdk path because i transfer the project from a windows PC to my macbook
Cleaning and re-building the project
Deleting Pods folder and podfile.lock file and running pod install again
But none of these solutions worked for me.
Note: I'm beginner on Flutter development :-)
I got an error when I tried to add flutter to an existing iOS app it worked fine on the android side, in IOS I got this error message :
/Users/mac/Library/Developer/Xcode/DerivedData/Fixit- dffmmspbqmueppghdvveloietubr/Build/Intermediates.noindex/Fixit.build/Debug- iphoneos/Fixit.build/Script-04B0EA9A232E6ABD008A0448.sh: line 3: /packages/flutter_tools/bin/xcode_backend.sh: No such file or directory
/Users/mac/Library/Developer/Xcode/DerivedData/Fixit- dffmmspbqmueppghdvveloietubr/Build/Intermediates.noindex/Fixit.build/Debug- iphoneos/Fixit.build/Script-04B0EA9A232E6ABD008A0448.sh: line 4: /packages/flutter_tools/bin/xcode_backend.sh: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
inside my pod file i added this inside target application:
flutter_application_path = 'Users/mac/FixitApps/customerApp/fixit_flutter_customer_app/'
eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding)
I followed this tutorial: https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps
if you create a script file in the build phase for building dart code remove it and add this to your podfile :
flutter_application_path = 'Users/mac/FixitApps/customerApp/fixit_flutter_customer_app/'
eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding)
install_all_flutter_pods(flutter_application_path)
In my case when I have deleted some files from assets but forget to remove from pubspes.yaml.
Error solved after
remove deleted files from pubspes.yaml
click on pub get.
run on device
I am using a cloud virtual computer to build my iOS apps, in that case when I'm building the app, the machine got disconnected after I connect it again this above error popped up. But after I turn off the machine and restarted it, this error did not pop up.