Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 424 Vote(s) - 3.58 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code

#11
**Build phases** > **Add** > **New Run Script Phase**

Code:

# Type a script or drag a script file from your workspace to insert its path.
# skip if we run in debug
if [ "$CONFIGURATION" == "Debug" ]; then
echo "Skip frameworks cleaning in debug version"
exit 0
fi

APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"

# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"

EXTRACTED_ARCHS=()

for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done

echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"

echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"

done



Xcode will refuse to sign them. The above script removes unused architectures.
Reply

#12
This issue is literally related to your Xcode build phase script. <br>
In my case, In the `Target -> Build Phases -> Bundle React Native code and Images`, I found some issue in my build script for Sentry. <br>
It was the path that node binary is located. My script wanted node to be in `usr/local/bin/node` but my path was `opt/homebrew/bin/node` something like that. <br>
So I just uninstalled node via homebrew and installed node directly from their homepage.
Reply

#13
In XCode 14.3 release, this issue is causing most of the time. The below-mentioned solution works for me.

1. First you have to Clean Project using command+shift+k
2. Now re-install pods, and increase the library development target if required. (in Xcode 14.3, the minimum requirement is iOS<= 11.0)
3. Find source="$(readlink "${source}")" globally and replace with source="$(readlink -f "${source}")" on all the places.
4. Now try to archive.

if it does not works, then delete Podfile.lock and Pods folder from your project root path. and then start from 2ns step.
Reply

#14
There is an issue with Cocoapods now because **Xcode 14.3** is now using a relative path in its symlink for frameworks.

Either wait for release of Cocoapods version 1.12.1 or make this simple change in your **Pods-APPNAME-frameworks.sh** file:

**APPNAME** is your Application name


you need to SEARCH and REPLACE:

if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi

with

if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi

Note that **-f** was added.




[![enter image description here][1]][1]

[![enter image description here][2]][2]


[1]:

[2]:
Reply

#15
**XCODE 14.3**

There are a number of reasons for this error, I encountered it with rsync issue when archiving my project.

There is an issue with Cocoapods now, because Xcode 14.3 is now using a relative path in its symlink for frameworks.

Either wait for release of Cocoapods version 1.12.1 or make this simple change in your Pods-APPNAME-frameworks.sh file:

Replace:


if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi

With:

if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi

Note that -f was added.

You can find this file in

`Pods > Target Support Files > Pods-'Your-ProductName' > Pods-YourProductName-Frameworks.sh`

Open the file in any text editor and make the change.

Original Source of this solution can be found in this [Link][1]

[1]:

[To see links please register here]

Reply

#16
**If your issue is run custom shell script cp embed pods frameworks fails than here is the answer for you**

It seems like there is an issue on Xcode 14.3 and higher. There are open issues on iOS developer forum.

ref:

[To see links please register here]


An idea could be to downgrade to 14.2 and see if it works.

Another workaround without downgrading: Open project in Xcode. Go to Pods -> Target Support Files -> Pods-YOUR_APP-Frameworks and change line 44 to below to

source="$(readlink -f "${source}")"
Reply

#17
I bumped into this issue when upgrading react native from 0.68 to 0.69.

I was missing ```ios/.xcode.env.local``` file. Just added result of ```which node``` there for ```NODE_BINARY```: ```export NODE_BINARY="/opt/homebrew/bin/node"``` there as in ```ios/.xcode.env``` and problem was fixed;
Reply

#18
In my case, the problem occurred because I changed my Intel Core i5 processor to an Apple m2 processor.

**Please follow the below steps -**

Step 1 - Open Finder -> Applications -> Xcode (right click) -> Get Info -> Open with Rosetta check the box

Step 2 - Open Finder -> Applications -> Utilities -> Terminal (right click) -> Open with Rosetta.

Step 3 - Restart the machine. Then it will ask for Rosetta installation. Install Rosetta. Then run Xcode.
Reply

#19
If you newer version of Xcode you can do check this box Targets -> Build Phases -> Run Script ->check box>For install builds only[![enter image description here][1]][1]


[1]:
Reply

#20
Solution for Flutter users
--------------------------

In case your app was developed using Flutter, the above steps worked for me:

Run:
1. flutter run
2. flutter pub get
3. run `pod install` inside the iOS folder
4. build
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through