Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

swift - 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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...