nixzhu / MonkeyKing

MonkeyKing helps you to post messages to Chinese Social Networks.
MIT License
2.76k stars 240 forks source link

生成 MonkeyKing.xcframework 后无法使用 #178

Closed lexrus closed 4 years ago

lexrus commented 4 years ago

我用如下脚本生成新的 xcframework:

xcodebuild archive -project "China.xcodeproj" \
    -scheme "MonkeyKing" -configuration Release \
    -sdk iphonesimulator \
    -archivePath "Build/MonkeyKing/Simulator" \
    SKIP_INSTALL=NO \
    BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive -project "China.xcodeproj" \
    -scheme "MonkeyKing" -configuration Release \
    -sdk iphoneos \
    -archivePath "Build/MonkeyKing/iOS" \
    SKIP_INSTALL=NO \
    BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild -create-xcframework \
    -framework Build/MonkeyKing/Simulator.xcarchive/Products/Library/Frameworks/MonkeyKing.framework \
    -framework Build/MonkeyKing/iOS.xcarchive/Products/Library/Frameworks/MonkeyKing.framework \
    -output xcframeworks/MonkeyKing.xcframework

使用时会出现这些问题:

Screen Shot 2020-09-17 at 8 46 39 PM Screen Shot 2020-09-17 at 8 46 58 PM

搜索了一下可能是因为这个 bug: https://forums.swift.org/t/frameworkname-is-not-a-member-type-of-frameworkname-errors-inside-swiftinterface/28962

lexrus commented 4 years ago

我改了项目生成的 framework 的 target 的名字之后才可以正常编译使用...

Screen Shot 2020-09-17 at 9 09 23 PM Screen Shot 2020-09-17 at 9 10 24 PM
nixzhu commented 4 years ago

还没研究过 XCFramework,有可能直接从 Package.swift 生成吗?😄

lexrus commented 4 years ago

fixed in https://github.com/nixzhu/MonkeyKing/releases/tag/pre-1.17.0 @nixzhu