Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to push to app store while archiving worked #129

Closed
uchiha-itachi95 opened this issue Aug 23, 2021 · 1 comment
Closed

Failing to push to app store while archiving worked #129

uchiha-itachi95 opened this issue Aug 23, 2021 · 1 comment

Comments

@uchiha-itachi95
Copy link

Description

I have integrated razorpay-pod with our ios app. Everything is working fine. Built the archive also. But failed to push it to app store.

Razorpay pod Version :

1.1.6

Xcode Version :

Version 12.3 (12C33)

What you did:

Built the archive. Was trying to push it to app store for TestFlight for internal testing. Got error in between. Screenshot below.

What happened:

It gave multiple errors regarding the binary that was sent to the app store. Screenshot below.

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

Suggested solution:

Code example, screenshot, or link to a repository:

Screenshot 2021-08-23 at 11 31 15 AM

@uchiha-itachi95
Copy link
Author

So the problem is it contains both the architecture for simulator and real device which of course is not allowed for play store release. So you have to strip out the simulator architecture before submitting to app store.

Just add the below run script in your build phase and you will be good to go.

APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
FRAMEWORK_NAME="Razorpay.framework"
# Check if Framework is present.
FRAMEWORK_LOCATION=$(find "$APP_PATH" -name "$FRAMEWORK_NAME" -type d)
if [ -z $FRAMEWORK_LOCATION ]; then
echo "Couldn't find Razorpay.framework in $APP_PATH. Make sure 'Embed Frameworks' build phase is listed before the 'Strip Unused Architectures' build phase."
exit 1
fi
# This script strips unused architectures
find "$APP_PATH" -name "$FRAMEWORK_NAME" -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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant