Implementing Script at Build Phase in Xcode - xcode

I've been attempting to implement the Perl script found here: best way to add license section to iOS settings bundle
I've followed the instructions given to a T but when I go to run my project I get the following error after changing the permissions of the script to CHMOD 755:
No such file or directory at ./LicenseScript.pl line 10.
Command /bin/sh failed with exit code 2
Why won't my app compile?

Related

Cannot execute golang executable after building

I have to preface that I am beginner when it comes to using Go. I have cloned a project that can be found at https://gitlab.com/gitlab-org/security-products/analyzers/common.git
Before building, the environment variables for go are GOARCH=amd64 GOOS=linux.
After cloning the project I navigate to into the directory that has go files, that is command/, and run the following command go build -o analyzer
This outputs a file called analyzer. The one I noticed is that I can't execute this file unless I do chmod +x analyzer.
When I do execute the that binary I get an error
./analyzer: line 1: syntax error near unexpected token `newline'
./analyzer: line 1: `!<arch>'
That package is not a main package. Only main packages (with the package main statement) will build into executable files.

Command PhaseScriptExecution failed with a nonzero exit code - No such file or directory

Every time I try to run my iOS app on Xcode 10, it fails and gives me the error "Command PhaseScriptExecution failed with a nonzero exit code"
The full error description is:
bash: /Users/Noah 1/Library/Developer/Xcode/DerivedData/WeatherSando-dszhaqymmhxfptfiymvnuvshlbtb/Build/Products/Debug-iphoneos/WeatherSando.app/Frameworks/AerisCore.framework/strip-frameworks.sh: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
I removed all AerisWeather CocoaPods from my project, what is wrong?
For me worked what #Phillip Mills suggested. Build phase references the framework which has been removed.
In my case I removed manually embedded framework which I replaced with CocoaPod dependency. I needed script which there was previouly no longer but I didn't remove it.
So, look to Build Phases for your target and remove Run script
In my case, I had wrong project folder name. Project folder name shouldn't include the space
For me it was upgrading Plaid from 1.0.0 to 3.0.0. They have a Build Phase to strip the iOS Simulator part from the framework. I had to remove that for it work. Details found here:
https://plaid.com/docs/link/ios/ios-v2-migration/
I have resolved this error by removing the spaces in the folder name, inside which this project was set up.
After removing space, it worked

How can I embed CEF3 into my OSX application?

I like to use the Chromium browser instead of the WebKit browser in my OS X project.
I downloaded the binary files at https://cefbuilds.com
I builded with cmake that creates a cef.xcodeproj.
Once I open that and want to build it. It first gives me problems because virtual bool Execute needs to be override. When I solved that error it goes a lot futher but crashes at:
cefsimple /bin/sh: tools/make_more_helpers.sh: /bin/bash: bad interpreter: Operation not permitted
make: *** [cefsimple_buildpart_2] Error 126
Command /bin/sh failed with exit code 2
Can anyone explain what I'm doing wrong?
In OS X versions 10.7.4 and above extended attributes are added to executable files (including shell scripts) and handled by the security settings you have defined for your account. For example checking the xattr on one of your build scripts might look similar to this:
$ ls -l# make_more_helpers.sh
-rwxr-xr-x# 1 Hellman staff 3564 Sep 2 07:02 make_more_helpers.sh
com.apple.quarantine 23
When Xcode tries to execute the script (again depending on your security settings) it will look at the extended attributes and determine whether or not to allow it to execute. If it finds that the creator of the script has not been approved you will receive an error such as:
make_more_helpers.sh: /bin/bash: bad interpreter: Operation not permitted
Fortunately it's an easy fix and there are quite a few ways to remedy it. One such way would be to associate scripts that are part of projects you build with Xcode. You could also open the script in an editor that is allowed to run scripts and re-save it, or just recursively scan your build directory for files with quarantine attributes and remove the attribute:
xattr -rd com.apple.quarantine /path/to/build
After you do this you should notice that doing another ls -l# on your script the # following the permissions and the com.apple.quarantine should be removed. Now when you try building your project the script should be allowed to execute and succeed.
↳ https://developer.apple.com/library/mac/documentation/OpenSource/Conceptual/ShellScripting/BeforeYouBegin/BeforeYouBegin.html

XCode 7 Otool failing to copy file during build

[OSX 10.10.5, XCode 7.0.1]
I'm getting an error during my build stating that Otool can't copy a file:
error: otool: can't open file: /usr/local/opt/llvm/lib/libclang.3.6.dylib: (No such file or directory)
The two lines before the error (and what I think is causing it, because there are no other error indications) are:
cp -p /usr/local/opt/llvm/lib/libclang.3.6.dylib /Users/me/Library/Developer/Xcode/DerivedData/MiCASE-asvgjysohljplretlamgcpgnxgiq/Build/Products/Debug/MiCASE.app/Contents/Frameworks
cp -p /usr/local/opt/llvm/lib/libclang.3.6.dylib: /Users/me/Library/Developer/Xcode/DerivedData/MiCASE-asvgjysohljplretlamgcpgnxgiq/Build/Products/Debug/MiCASE.app/Contents/Frameworks
When I manually perform the command in a terminal, it works fine. I've set the permissions of the dynamic library to me:admin 777, so the file definitely exists. Thus I don't understand why I am getting the error.
This leads me to believe there is something else that is failing but the build log isn't showing it.
I'm also getting this error at the end of the script, but I think it's due to the above:
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure
Solution
#trojanfoe, thanks for the info.
The problem was that as part of the build, a script was being run. In the script otool was being used to extract dependencies, and filtering of its output was done incorrectly. Fixing the filtering resolved the issue.

xCode external build No such file or directory

I have added a new target with external build in xCode 4.3.2 which is suposed to run a shell script. The script is in a folder Scripts/update.sh in the project.
My external build tool configuration are:
Build Tool /bin/bash
Arguments ../Scripts/update.sh
But when i run i get:
/bin/bash: ../Scripts/update.sh: No such file or directory
How do i refer the file correct?
According to Apple's Documentation, it looks like you probably want refer to update.sh as:
${SRCROOT}/Scripts/update.sh

Resources