I have created one custom framework with 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"`
The generated framework will be using in another project via pod. this is working fine in iOS device and iphone simulator ( non-rosetta enabled )
when i try to run on rosetta enabled simulator. its causing the issues like unsuported switch architecture.
deployment target, swift version all same .




