While submitting my app on an Apple store, I am getting the following error.
ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at '.....app/Frameworks/libstdc++.6.0.9.dylib' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."
I am using Xcode 11.4. Do I need to update it? I included the following run script in build phases.
# 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
Thanks for your help :).
Issue was with 'libstdc++.6.0.9.dylib' library. I was using an old framework that uses this library and because I was running my code on the simulator, therefore, I needed this library at runtime to run my code on a simulator that supports iOS 13. You do not need the support of this lib on the device. After removing the library from Embedded Frameworks, everything works fine now. For a more detailed answer, check this link.
https://github.com/gali8/Tesseract-OCR-iOS/issues/379
Related
My question is very simple, is anyone using Gigya Swift SDK Framework 1.0.11 noticed the missing file needed for the Run Script Build phase? How did you cope with that?
Basically that's the file needed in the Run Script Build Phase, invoked this way:
bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Gigya.framework/ios-framework-build.sh" Gigya
Thanks anyone providing an answer!
This is a normal script to removes unused architectures.
You can take it from the old version and put in the Gigya.framework folder or take the following code and save as ios-framework-build.sh in the Gigya.framework.
Removes unused architectures script:
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
I had integrated the JWPlayer with my iOS Application and it's working well but today I tried to upload the application to the Apple Testflight I got the error regarding the "Code SignIn issue" with the JWPlayer SDK.
Also, I had tried to change the embed option with all the available options like
Embed & Sign
Do not embed
Embed without sign
Archives Validation
Code SignIn Issue
Steps Taken
Finally, I resolved this issue using a build run script.
So I'm sharing the same with you, I hope this will also work if someone faces any code signing issue while validating application, same as mine.
Here is the build run script:
Open your build phase
Click '+' and click on "New run script phase"
Open the run script shell and paste the below code
# 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 ‘YOUR_FRAMEWORK_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
If you face the issue in only one framework then just replace 'YOUR_FRAMEWORK_NAME.framework' with your framework name with their extension and if you face the same in many frameworks then just replace 'YOUR_FRAMEWORK_NAME.framework' with '*.framework'.
Compile and Run the Project.
Finally, Archive and Upload the build to Testflight.
And it's done.
I am adding embedded framework in my project but after adding this framework I am not able to upload build to app store. I have searched a lot on Google and added this script into Run script.
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
But it's also giving error. I think it's .sh file genrating this error but I have not any solution for getting out from this problem. I am sharing screen shot of the error I am getting. Please help and suggest what I will have to do.
Xcode version 7.2
BrainTreeFramework 3.9.7
When i try to upload build to test flight getting unsupported architecture.
I spent many hours on this.but no success.
any help will be appreciated.
thanks in advance
enter image description here
The problem is that the BrainTreeFramework contains a build for both the simulator (x86_64) and the actual devices (ARM).
you need to "manually" remove the unnedeed architectures from the final binary, before submitting it.
Daniel Kennett given a nice solution and provides this script to add to the build phase:
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
go through the link once it will work for me.
It is impossible to send in itunesconnect new version of the application. Although last week, the same version send happened. In the code, I just changed the name of a button, no more changes are not made where.
But always get error:
ERROR ITMS-9000: "Unsupported architectures. Your executable contains unsupported architectures '[x86_64, i386]'"
In my project -> Build Settings:
ARCHS = $(ARCHS_STANDARD_32_BIT)
//:configuration = Debug
ONLY_ACTIVE_ARCH = YES
//:configuration = Release
ONLY_ACTIVE_ARCH = NO
VALID_ARCHS = armv7 armv7s
Check out this slick solution on Daniel Kennett's blog - it worked perfectly for me with the SpritzSDK, which I had similar issues with.
He supplies a script you can drop-in to your build phases to strip out the unwanted architectures as a last step - doesn't break the simulator, and iTunesConnect approved my upload as well on the first try.
http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/
You can remove unwanted ARCHS from IPA by putting below peace of Shell Script in Build Phase -- > RUN Script
This Script removes all simulator ARCHS from IPA and ARCH issues from Embedded framework.
Source :
http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/
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
The script in the above two answers needs to be edited if you have an watch app in your project. Add /Frameworks to the $APP_PATH to avoid errors when building the project.
If you are using LiveSDK directly or via ShareKit, you will run into this problem. In my case I was using LiveSDK directly.
Check this answer on Apple Developer Forum
https://devforums.apple.com/message/1037603#1037603