client-sdk-swift icon indicating copy to clipboard operation
client-sdk-swift copied to clipboard

When the Livekit SDK is included as a dependency in another framework, the framework fails to build.

Open indaos opened this issue 1 year ago • 11 comments

Describe the bug While attempting to build an XCframework with LiveKit SDK as a dependency, I encountered the following errors.

/Users/daos/Library/Developer/Xcode/DerivedData/UnbluMobileSDK-bhhgojhqukhuwwegpvpuskbnsguw/Build/Intermediates.noindex/LiveKit.build/Release-iphoneos/LiveKit.build/Objects-normal/arm64/LiveKit.swiftinterface:5:8: error: no such module 'CHeaders'
import CHeaders
       ^
/Users/daos/Library/Developer/Xcode/DerivedData/UnbluMobileSDK-bhhgojhqukhuwwegpvpuskbnsguw/Build/Intermediates.noindex/LiveKit.build/Release-iphoneos/LiveKit.build/Objects-normal/arm64/LiveKit.swiftinterface:1:1: error: failed to verify module interface of 'LiveKit' due to the errors above; the textual interface may be broken by project issues or a compiler bug

SDK Version 2.0.1

iOS/macOS Version XCode 15.1

indaos avatar Feb 08 '24 17:02 indaos

I can't reproduce this using Xcode 15.2. Did it work for you with v1 ? I checked the diff but there was no changes for CHeaders from v1 -> v2.

hiroshihorie avatar Feb 09 '24 19:02 hiroshihorie

I built my own XCFramework (not an app), which has a dependency on Livekit via SPM. Did you do the same? Because such errors are quite common in this specific case.

indaos avatar Feb 09 '24 21:02 indaos

I just tried version 2.0.2 with 15.2, and the error still exists. Usually, it has nothing to do with "CHeaders" (or similar) itself but rather with the presence of "import CHeaders" in the "swiftinterface" file.

indaos avatar Feb 09 '24 21:02 indaos

I'll retry this, thanks for the report.

hiroshihorie avatar Feb 10 '24 02:02 hiroshihorie

There are no problems with Xcode 14.2 and version 2, but with version 15, issues arise, not just with CHeaders. When I added @_implementationOnly to import CHeaders just for checking purposes, other errors related to different issues appeared.

indaos avatar Feb 20 '24 10:02 indaos

Can you create a minimal reproducible project and attach it here ?

hiroshihorie avatar Feb 21 '24 05:02 hiroshihorie

LiveKitTest.zip Hi! use local_build.sh in the project directory

indaos avatar Feb 21 '24 06:02 indaos

@indaos Can you try building using this branch ? https://github.com/livekit/client-sdk-swift/pull/356

hiroshihorie avatar Mar 11 '24 09:03 hiroshihorie

things have changed, but I got the following errors: image

indaos avatar Mar 11 '24 10:03 indaos

I can build frameworks depending on LiveKit, can you try again with v2.0.6 ?

hiroshihorie avatar Apr 26 '24 04:04 hiroshihorie

Have you seen the related issue I posted recently https://github.com/livekit/client-sdk-swift/issues/364#issue-2240095214 I still have the same thing. please explain in more detail how you did this, maybe I missed something...

indaos avatar Apr 26 '24 08:04 indaos