XCFramework "... is not a member type of ..." error
打包xcframework方式:
xcodebuild archive -scheme FastSocket -destination generic/platform=iOS -archivePath ./FastSocket.xcarchive SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES xcodebuild -create-xcframework -framework FastSocket.xcarchive/Products/Library/Frameworks/FastSocket.framework -output FastSocket.xcframework
项目是Swift和Objc混合开发,有一个Swift类名和ModuleName相同,当打包成xcframework引入到项目时, 会报错... is not a member type of ...
We faced the following issue in almost all our frameworks. Because we had class names matching the SDK names, just like the old FAT framework. ‘FrameworkName’ is not a member type of ‘FrameworkName’ errors inside swiftinterface
解决方案:
1、把和ModuleName同名的类改名
2、采用临时方案,在xcframework的根目录执行下面脚本:
find . -name "*.swiftinterface" -exec sed -i -e 's/ModuleName\.//g' {} \;
Xcode 11 XCFramework "... is not a member type of ..." error

浙公网安备 33010602011771号