Xcode 12.3 failed on some 3rd framework and librarys?


I have just update Xcode to Xcode 12.3 , and my project can't compile , it complains:
Code Block
Building for iOS Simulator, but the linked and embedded framework 'ITLogin.framework' was built for iOS + iOS Simulator.

This framework is worked well before Xcode 12.3 , so what's the problem here ?

Answered by DTS Engineer in 652663022
This framework isn't built with a supported configuration -- iOS and iOS Simulator code has never been supported in the same binary. The linker in Xcode 11 began identifying these incorrect configurations and issuing warnings, and Xcode 12 goes further in identifying these issues.

The only correct way to resolve this is to rebuild the framework as an XCFramework. If this is your framework, or owned by another group in your company, follow the information in the video and the Xcode Help article.

If this framework is from a vendor, then you need to work with the vendor to get an updated version of the framework built with supported configuration.

In the discussion of this thread, there is a build script that attempts to resolve this error. Scripts like that -- anything that tries to manipulate the output with commands like lipo -- still produces an unsupported configuration in the binary. XCFrameworks are the way to go.
Same, what's the problem here ? Anyone ?
Same problem, the Framework worked well before xCode 12.3 .
Same problem here. Any work around?
We can't also build it with the device, not only the simulator.
Same, but not finding any solutions.

Here's the link to download Xcode 12.2 again for those who want to go back to previous version:
https://download.developer.apple.com/Developer_Tools/Xcode_12.2/Xcode_12.2.xip
I also have the same problem.
Same problem! And XCode 12.3 constantly freezing

I had same issue. I solved them by rebuild the frameworks as the XCFramework.
You can make it compile doing this steps:

1) Set your framework in XCode to "Do not embed" (General>Frameworks, Libraries and Embedded Content)
2) Add a "new run script phase" in "Build Phases" with:
Code Block
FRAMEWORK_APP_PATH="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
# 1. Copying FRAMEWORK to FRAMEWORK_APP_PATH
find "$SRCROOT" -name '*.framework' -type d | while read -r FRAMEWORK
do
if [[ $FRAMEWORK == *"FAT_FRAMEWORK.framework" ]]
then
echo "Copying $FRAMEWORK into $FRAMEWORK_APP_PATH"
cp -r $FRAMEWORK "$FRAMEWORK_APP_PATH"
fi
done
# 2. Loops through the frameworks embedded in the application and removes unused architectures.
find "$FRAMEWORK_APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
if [[ $FRAMEWORK == *"FAT_FRAMEWORK.framework" ]]
then
echo "Strip framework: $FRAMEWORK"
FRAMEWORK_EXECUTABLE_NAME=$(/usr/libexec/PlistBuddy -c "Print CFBundleExecutable" "$FRAMEWORK/Info.plist")
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"
codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements $FRAMEWORK_EXECUTABLE_PATH
else
echo "Ignored strip on: $FRAMEWORK"
fi
done

PS: Be sure to replace FAT_FRAMEWORK by YOUR_FRAMEWORK_NAME (ex: ITLogin) and place it at the root of your project.
I have the same problem - note, that to download the old Xcode 12.2, you can't click the link that was shared, you have to go to like https://developer.apple.com/download/more/?=xcode and download it there.

One 'solution' is to switch to using the static version of the library, if that's available. The problem in my case is that this cripples the development speed - using the equivalent static lib adds 20 seconds to the link time, taking a 4 second incremental build up to like 24 seconds.
Does anyone have a radar open for this issue?
There seems to be an architecture check issue and some updates that weren't included in the release notes: https://developer.apple.com/documentation/xcode-release-notes/xcode-12_3-release-notes/. No idea if this is intentional, a bug, or how to resolve them.
This framework isn't built with a supported configuration -- iOS and iOS Simulator code has never been supported in the same binary. The linker in Xcode 11 began identifying these incorrect configurations and issuing warnings, and Xcode 12 goes further in identifying these issues.

The only correct way to resolve this is to rebuild the framework as an XCFramework. If this is your framework, or owned by another group in your company, follow the information in the video and the Xcode Help article.

If this framework is from a vendor, then you need to work with the vendor to get an updated version of the framework built with supported configuration.

In the discussion of this thread, there is a build script that attempts to resolve this error. Scripts like that -- anything that tries to manipulate the output with commands like lipo -- still produces an unsupported configuration in the binary. XCFrameworks are the way to go.
So it looks like the standard Carthage workflow, which builds fat frameworks, is incompatible with Xcode 12.3, correct?
Same here. Is there anyone at Apple that can shed some light and provide some kind of direction on this?

I mean is this an Xcode issue or something that devs need to address or is this for the 3rd party whose library and frameworks are causing this issue to fix?
Someone helped me with this instructions for the same problem with TwilioVoice.framework and it worked perfect. Maybe you can adapt the instruction for your frameworks.

[https://github.com/twilio/twilio-voice-ios/issues/64#issuecomment-747186499)

Basically you separate the framework in the platforms and then you join them again as xcframework.
Finally, you include the new xcframework into your code.
Same here. 3rd party frameworks that worked fine up until 12.2 have stopped building / code signing. Going to have to downgrade to 12.2
So the problem is apple trying to force XCFramework bundle down, by breaking any project which relied on fat frameworks.
Just wow. I had a job to update broken third party dependency, now I have to repackage all of them, because who cares about compatibility. I just want to make iOS app, I don't care about M1 iOS simulators.
edford  wrote:

Scripts like that -- anything that tries to manipulate the output with commands like lipo -- still produces an unsupported configuration in the binary. XCFrameworks are the way to go.

The script at https://gist.github.com/evnik/6762d5c3a4b21f61f13b100e03b62c38 seems a legitimate way to address the issue by converting a FAT framework into an XCFramework using xcodebuild -create-xcframework, even though it uses lipo along the way.
I saw a lot of the solutions for this problem. 1. Use script https://developer.apple.com/forums/thread/669411?answerId=652489022#652489022 2. Add validate workspace's parameter to xcodeproj. I just want apple to clarify about how long fat binary still be supported. I'm afraid that if I use these solutions to avoid the fact that apple want us to use XCFramework One day apple suddenly decide to not support fat binary, then we're gonna have the real big problem.

Its working for me, just need to do is below command in terminal: also make sure you have installed command line tools from below link https://developer.apple.com/download/all/

xcrun xcodebuild -create-xcframework \
    -framework /path/to/ios.framework \
    -framework /path/to/sim.framework \
    -output combined.xcframework
Xcode 12.3 failed on some 3rd framework and librarys?
 
 
Q