Xcode 10: Code Signing My App+Framework Fails, Because of Failure Signing 3Rd Party Dependency Framework (Promisekit). Works in Xcode 9

Xcode 10: Code Signing my App+Framework fails, because of failure signing 3rd party dependency framework (PromiseKit). Works in Xcode 9

Try this! It worked for me and many other people:

Goto

Build phases > Add > New Run Script Phase

The code should work for any default shell, but I recommend just using /bin/sh

and include the following 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

It seems hat some frameworks ship architectures, that will not be used in the application.
Xcode will refuse to sign them. The above script removes unused architectures.

Credits: Some guy at GitHub, I can't find the exact source anymore.

Xcode 11 use Framework in AppExtension

I'm kinda embarrassed but here's how I managed it:
1. Add the Framework to the main app (even tho I don't use or need it there). And make sure it's Embedded & Signed (see 2nd screenshot in question)
2. In the project settings for all extensions which need the framework, make sure the Framework status is: Do not Embed.

It's simple and easy if you know what to do....

Invalid Bundle while submitting swift app + framework

Try to disable Bitcode support

Project > Build Settings > All > Build Options > Enable Bitcode = NO

Maybe your library was compiled without Bitcode, but the setting above is enabled in your project by default in Xcode7



Related Topics



Leave a reply



Submit