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
How to Add "%" to Data in iOS-Chart
Pop to Root View Using Tab Bar in Swiftui
Swift Calling Static Methods: Type(Of: Self) VS Explicit Class Name
How to Get Current Location with Swiftui
Xcode: Could Not Load Modelio.Framework, Scenekit.Framework, etc
Checking If a Swift Class Conforms to a Protocol and Implements an Optional Function
Delegate Using Container View in Swift
Swift: Deallocate Gamescene After Transition to New Scene
Swift Generics: Cannot Convert Value of Type to Expected Argument Type
Nsuserdefaults in Swift - Implementing Type Safety
Prettier Debug Output Printing Swift Dictionary in Xcode
Detect Ethernet/Wifi Network Change
Swift Check Type Against a Generic Type
Insert, Update and Delete Animations with Foreach in Swiftui
Disable Audio (And Interruption) with Mpmovieplayercontroller Using Swift
In Swift, When Using "[Weak Self] In", Should I Double Up on It When Nested Inside Another Closure