Search code examples
swiftxcodexcode12xcframework

Creating XCFramework can't find a valid framework


I made empty framework project MyFramework and try to create XCFramework

Xcode 12.3, 12.2, 11.7 macOS Catalina, Big Sur

in terminal I write:

xcodebuild archive \
-project "MyFramework.xcodeproj" \
-scheme MyFramework \
-archivePath ~/Desktop/MyFramework-iphoneos.xcarchive \
-sdk iphoneos \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES

it generates MyFramework-iphoneos.xcarchive successfully

but when I write in terminal:

xcodebuild -create-xcframework -framework '~/Desktop/MyFramework-iphoneos.xcarchive/Products/Library/Frameworks/MyFramework.framework' -output '~/Desktop/MyFramework.xcframework'

it returns error:

error: the path does not point to a valid framework: ~/Desktop/MyFramework-iphoneos.xcarchive/Products/Library/Frameworks/MyFramework.framework

What is the reason and how to fix it?


Solution

  • It appears that problem was in relative path like "~/Desktop" Using instead "users/username/documents..." solved this problem