bielikb/xcframeworks

Cannot build the final product - No such module 'StaticLibrary'

igor-makarov opened this issue · 5 comments

I have tried building the Sample app and have encountered the aforementioned error.
How did you get it to work on your end?

It seems that archiving a static library deletes its .swiftmodule.

@bielikb is this an Xcode issue?

How did you manage to get it to build?

Hey @igor-makarov,

does it build for you in the latest master?
The static library was not properly embeded in the Sample project.

Re Module Stability:
Module Stability is not there yet for the static libraries. As you mentioned above, the archive, nor final xcframework doesnt contain required public interface. Although the swiftmodule is provided for the build action. I guess this will change with next betas/GM of Xcode.
Ill keep my eye on this issue.

Thanks!

It still doesn't build. It's not surprising, considering that the .swiftmodule isn't present in either the archive or the XCF.
I think this might be an Apple issue so I opened a Radar: https://openradar.appspot.com/6929466

I was wondering however, how come it builds for you and not for me.

Thanks for the radar.

What macOS version are you using?
I was able to run the Sample on the latest Mojave.
Could you share the console log of the archive/create xcframework process?

I'm on Catalina, latest beta.

Log:

#####################
▸ Cleaning the dir: Products
▸ Archive StaticLibrary
▸ Starts archiving the scheme: StaticLibrary for destination: generic/platform=iOS Simulator;
▸ Archive path: Products/archives/StaticLibrary-SIMULATOR.xcarchive
2019-08-07 10:53:06.315 xcodebuild[30370:328292] Skipping test plans upgrade for container at '<DVTFilePath:0x7ff8bcb1ef70:'/Users/Igor/xcframeworks/XCFrameworks.xcworkspace'>' because shouldPerformUpgrade returned false
2019-08-07 10:53:06.871 xcodebuild[30370:328385]  DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
2019-08-07 10:53:07.158 xcodebuild[30370:328292] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7ff8bf2c5ad0), iPhone D22, iPhone, 13.0 (17A5547d), 813ca86f1dcfd73c61f5207214469b62bff9f490> == Underlying device preparation errors ==
2019-08-07 10:53:07.158 xcodebuild[30370:328292] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7ff8bf2c5ad0), iPhone D22, iPhone, 13.0 (17A5547d), 813ca86f1dcfd73c61f5207214469b62bff9f490> -- Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <DVTPlatform:0x7ff8ba538e30:'com.apple.platform.iphoneos':<DVTFilePath:0x7ff8ba538c70:'/Applications/Xcode-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform'>>. DTDKDeviceIdentifierIsIDID: 0
--
2019-08-07 10:53:07.158 xcodebuild[30370:328292] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7ff8bf2c5ad0), iPhone D22, iPhone, 13.0 (17A5547d), 813ca86f1dcfd73c61f5207214469b62bff9f490> == END: Underlying device preparation errors ==
2019-08-07 10:53:07.607 xcodebuild[30370:328292] [MT] DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
2019-08-07 10:53:07.613 xcodebuild[30370:328292] [MT] DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
2019-08-07 10:53:07.618 xcodebuild[30370:328292] [MT] DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
2019-08-07 10:53:07.620 xcodebuild[30370:328292] [MT] DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
2019-08-07 10:53:07.630 xcodebuild[30370:328292] [MT] DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
2019-08-07 10:53:07.633 xcodebuild[30370:328292] [MT] DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
▸ Compiling StaticLibrary.swift
▸ Building library libStaticLibrary.a
▸ Archive Succeeded
▸ Starts archiving the scheme: StaticLibrary for destination: generic/platform=iOS;
▸ Archive path: Products/archives/StaticLibrary-DEVICE.xcarchive
2019-08-07 10:53:09.396 xcodebuild[30446:328714] Skipping test plans upgrade for container at '<DVTFilePath:0x7ff2c3b38c20:'/Users/Igor/xcframeworks/XCFrameworks.xcworkspace'>' because shouldPerformUpgrade returned false
▸ Compiling StaticLibrary.swift
▸ Building library libStaticLibrary.a
▸ Archive Succeeded
▸ Starts archiving the scheme: StaticLibrary for destination: generic/platform=macOS;
▸ Archive path: Products/archives/StaticLibrary-MAC.xcarchive
2019-08-07 10:53:11.126 xcodebuild[30478:329137] Skipping test plans upgrade for container at '<DVTFilePath:0x7f9f355bf180:'/Users/Igor/xcframeworks/XCFrameworks.xcworkspace'>' because shouldPerformUpgrade returned false
▸ Compiling StaticLibrary.swift
▸ Building library libStaticLibrary.a
▸ Archive Succeeded
▸ Create .xcframework
xcframework successfully written out to: /Users/Igor/xcframeworks/Products/xcframeworks/StaticLibrary.xcframework
▸ Archive DynamicFramework
▸ Starts archiving the scheme: DynamicFramework for destination: generic/platform=iOS Simulator;
▸ Archive path: Products/archives/DynamicFramework-SIMULATOR.xcarchive
2019-08-07 10:53:13.975 xcodebuild[30519:329837] Skipping test plans upgrade for container at '<DVTFilePath:0x7ff3fb9c38a0:'/Users/Igor/xcframeworks/XCFrameworks.xcworkspace'>' because shouldPerformUpgrade returned false
▸ Compiling Package.swift
▸ Compiling Package.swift
▸ Linking Package.o
▸ Linking Package.o
▸ Processing Info.plist
▸ Copying DynamicFramework.h
▸ Compiling Sum.swift
2019-08-07 10:53:14.752 xcodebuild[30519:329902]  DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
2019-08-07 10:53:14.855 xcodebuild[30519:329837] [MT] DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
2019-08-07 10:53:14.858 xcodebuild[30519:329837] [MT] DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
▸ Compiling DynamicFramework_vers.c
2019-08-07 10:53:14.969 xcodebuild[30519:329837] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7ff3f9db3260), iPhone D22, iPhone, 13.0 (17A5547d), 813ca86f1dcfd73c61f5207214469b62bff9f490> == Underlying device preparation errors ==
2019-08-07 10:53:14.970 xcodebuild[30519:329837] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7ff3f9db3260), iPhone D22, iPhone, 13.0 (17A5547d), 813ca86f1dcfd73c61f5207214469b62bff9f490> -- Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <DVTPlatform:0x7ff3f6daf5a0:'com.apple.platform.iphoneos':<DVTFilePath:0x7ff3f6daf410:'/Applications/Xcode-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform'>>. DTDKDeviceIdentifierIsIDID: 0
--
2019-08-07 10:53:14.970 xcodebuild[30519:329837] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7ff3f9db3260), iPhone D22, iPhone, 13.0 (17A5547d), 813ca86f1dcfd73c61f5207214469b62bff9f490> == END: Underlying device preparation errors ==
▸ Linking DynamicFramework
2019-08-07 10:53:15.072 xcodebuild[30519:329837] [MT] DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
2019-08-07 10:53:15.075 xcodebuild[30519:329837] [MT] DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
▸ Generating 'DynamicFramework.framework.dSYM'
▸ Touching DynamicFramework.framework (in target 'DynamicFramework' from project 'DynamicFramework')
▸ Archive Succeeded
▸ Starts archiving the scheme: DynamicFramework for destination: generic/platform=iOS;
▸ Archive path: Products/archives/DynamicFramework-DEVICE.xcarchive
2019-08-07 10:53:16.507 xcodebuild[30585:330265] Skipping test plans upgrade for container at '<DVTFilePath:0x7fd43da2f000:'/Users/Igor/xcframeworks/XCFrameworks.xcworkspace'>' because shouldPerformUpgrade returned false
▸ Compiling Package.swift
▸ Compiling Package.swift
▸ Linking Package.o
▸ Linking Package.o
▸ Copying DynamicFramework.h
▸ Processing Info.plist
▸ Compiling Sum.swift
2019-08-07 10:53:17.387 xcodebuild[30585:330588]  DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
▸ Compiling DynamicFramework_vers.c
▸ Linking DynamicFramework
2019-08-07 10:53:17.490 xcodebuild[30585:330265] [MT] DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
2019-08-07 10:53:17.493 xcodebuild[30585:330265] [MT] DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
▸ Generating 'DynamicFramework.framework.dSYM'
2019-08-07 10:53:17.618 xcodebuild[30585:330265] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fd43db5c020), iPhone D22, iPhone, 13.0 (17A5547d), 813ca86f1dcfd73c61f5207214469b62bff9f490> == Underlying device preparation errors ==
2019-08-07 10:53:17.618 xcodebuild[30585:330265] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fd43db5c020), iPhone D22, iPhone, 13.0 (17A5547d), 813ca86f1dcfd73c61f5207214469b62bff9f490> -- Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <DVTPlatform:0x7fd43a13b740:'com.apple.platform.iphoneos':<DVTFilePath:0x7fd43a13b5b0:'/Applications/Xcode-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform'>>. DTDKDeviceIdentifierIsIDID: 0
--
2019-08-07 10:53:17.618 xcodebuild[30585:330265] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fd43db5c020), iPhone D22, iPhone, 13.0 (17A5547d), 813ca86f1dcfd73c61f5207214469b62bff9f490> == END: Underlying device preparation errors ==
▸ Touching DynamicFramework.framework (in target 'DynamicFramework' from project 'DynamicFramework')
▸ Archive Succeeded
▸ Starts archiving the scheme: DynamicFramework for destination: generic/platform=macOS;
▸ Archive path: Products/archives/DynamicFramework-MAC.xcarchive
2019-08-07 10:53:18.985 xcodebuild[30660:330656] Skipping test plans upgrade for container at '<DVTFilePath:0x7fef4397a9c0:'/Users/Igor/xcframeworks/XCFrameworks.xcworkspace'>' because shouldPerformUpgrade returned false
▸ Compiling Package.swift
▸ Linking Package.o
⚠️  ld: directory not found for option '-L/Applications/Xcode-beta5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/undefined'
⚠️  ld: directory not found for option '-L/Applications/Xcode-beta5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/undefined'
▸ Processing Info.plist
▸ Copying DynamicFramework.h
▸ Compiling Sum.swift
2019-08-07 10:53:19.879 xcodebuild[30660:330850]  DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
2019-08-07 10:53:19.982 xcodebuild[30660:330656] [MT] DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
2019-08-07 10:53:19.985 xcodebuild[30660:330656] [MT] DTDeviceKit: deviceType from 00008006-0002F4823A29002E was NULL
▸ Compiling DynamicFramework_vers.c
▸ Linking DynamicFramework
⚠️  ld: directory not found for option '-L/Applications/Xcode-beta5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/undefined'
⚠️  ld: directory not found for option '-L/Applications/Xcode-beta5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/undefined'
2019-08-07 10:53:20.159 xcodebuild[30660:330656] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fef417d1530), iPhone D22, iPhone, 13.0 (17A5547d), 813ca86f1dcfd73c61f5207214469b62bff9f490> == Underlying device preparation errors ==
2019-08-07 10:53:20.159 xcodebuild[30660:330656] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fef417d1530), iPhone D22, iPhone, 13.0 (17A5547d), 813ca86f1dcfd73c61f5207214469b62bff9f490> -- Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <DVTPlatform:0x7fef3ee85bd0:'com.apple.platform.iphoneos':<DVTFilePath:0x7fef3ee85a10:'/Applications/Xcode-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform'>>. DTDKDeviceIdentifierIsIDID: 0
--
2019-08-07 10:53:20.159 xcodebuild[30660:330656] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fef417d1530), iPhone D22, iPhone, 13.0 (17A5547d), 813ca86f1dcfd73c61f5207214469b62bff9f490> == END: Underlying device preparation errors ==
▸ Generating 'DynamicFramework.framework.dSYM'
▸ Touching DynamicFramework.framework (in target 'DynamicFramework' from project 'DynamicFramework')
▸ Archive Succeeded
▸ Create DynamicFramework.xcframework
xcframework successfully written out to: /Users/Igor/xcframeworks/Products/xcframeworks/DynamicFramework.xcframework