I have created one xcframework library by using this below script :
[# Type a script or drag a script file from your workspace to insert its path.
#Gerenate device framework
xcodebuild archive -scheme ${PROJECT_NAME} -archivePath "${PROJECT_DIR}/build/${PROJECT_NAME}-iphoneos.xcarchive" -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
#Generate simulator framework
xcodebuild archive -scheme ${PROJECT_NAME} -archivePath "${PROJECT_DIR}/build/${PROJECT_NAME}-iossimulator.xcarchive" -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
#Generate xcframework for both arches
xcodebuild -create-xcframework -framework "${PROJECT_DIR}/build/${PROJECT_NAME}-iphoneos.xcarchive/Products/Library/Frameworks/${PROJECT_NAME}.framework" -framework "${PROJECT_DIR}/build/${PROJECT_NAME}-iossimulator.xcarchive/Products/Library/Frameworks/${PROJECT_NAME}.framework" -output "${PROJECT_DIR}/build/${PROJECT_NAME}.xcframework"
#Open directory where xcframework were generate
open "${PROJECT_DIR}/build"](https://www.example.com/)
its generated this folder with two slices.:
JawwyGamification.xcframework
ios-arm64
ios-arm64_x86_64-simulator
Info.plist
When i try to run on real device and apple slicon based simulator its wokring fine.
But when i try to run on rosetta simulator in my m1 mac xcode 14.3.1 i am getting unsuportted swift architecture error on ios-arm64 folder framework header .h file
Also i excluded the archtectire for my library and in project settings Any iOS simualator - arm64
then also no luck. but the wired thing is if i rearrange the slice order to this :
JawwyGamification.xcframework
ios-arm64_x86_64-simulator
ios-arm64
Info.plist
its working fine in all simulator and real device. I understand when i run on m1 mac rosetta simulator its failing to take the ios-arm64_x86_64-simulator. So the error is showing on ios-arm64 slice framework header
Any idea to fix this.
Additional info :
in my project library. :
Its an release build
Build Active architecture only - NO
Architecture - Standard
Post
Replies
Boosts
Views
Activity
We have one custom library/framework with ARCHS = $(ARCHS_STANDARD) under build settings. I export the library/framework with "Any iOS device" target and export the library/framework.
But when we try to integrate this custom library/framework in to another project ( M1 with xcode 14.2 with rosetta enabled ) its not running in iOS simulator. Getting error like. :
Unsupported Swift architecture
Note : Its running fine in real device.