AgoraIO / AgoraRtcEngine_iOS

iOS Package for Agora Video RTE SDK. Perfect for video calls and live streaming.
https://agoraio.github.io/AgoraRtcEngine_iOS/
MIT License
58 stars 17 forks source link

Our app has a local Swift Package that depeneds on Agora, dependencies not resolving #35

Closed jpmcglone closed 1 year ago

jpmcglone commented 1 year ago

Our app depends on (Note: we are updating from an old version of Agora (back from Nov, 2021))

LocalModule.Package has this:

.package(
  name: "AgoraRtcKit", // We also tried omitting this optional var
  url: "https://github.com/AgoraIO/AgoraRtcEngine_iOS",
  from: "4.1.1"
)

And I added "AgoraRtcKit" to the list of dependencies

dependencies: [
  "REDACTED",
  "REDACTED",
  "REDACTED",
  "AgoraRtcKit", // << Here
  "REDACTED",
  "REDACTED",
  .product(name: "REDACTED", package: "REDACTED"),
  .product(name: "REDACTED", package: "REDACTED"),
  .product(name: "REDACTED", package: "REDACTED"),
  .product(name: "REDACTED", package: "REDACTED"),
  .product(name: "REDACTED", package: "REDACTED")
]

And this simply won't load the package.

I see AgoraKitRtc in my resolved package dependencies, but it is unable to add it as a dependency of our target :(

Error: product 'AgoraRtcKit' required by package 'localmodule' target 'REDACTED' not found.

The way our app is architected, we can't add via xcode. Can someone help me get this working through this LocalModule.Package?

maxxfrazer commented 1 year ago

Hey @jpmcglone, this issue comes from the fact that AgoraRtcKit has been split up into several different products to minimise the footprint in your app.

If you add this to your dependencies instead, it should be good to go:

.product(name: "RtcBasic", package: "AgoraRtcKit")

It's the dependency that we use in the Video UI Kit here: https://github.com/AgoraIO-Community/VideoUIKit-iOS/blob/cfb3e9023d71558c2c892464b0e44ca180599c7f/Package.swift#L30

And to see all the package products in this package, check it out here: https://github.com/AgoraIO/AgoraRtcEngine_iOS/blob/main/Package.swift#L9-L22

jpmcglone commented 1 year ago

Giving this a try now, will report back soon.

jpmcglone commented 1 year ago

That seems to have fixed the SPM issues, thank you!

Now I just have to work on the actual port :) I think this issue is resolved. Thanks a ton @maxxfrazer