Date of slack thread: 8/6/24
Anonymous: Hello. Statsig team! I have a question regarding usage of https://github.com/statsig-io/ios-sdk as SPM module. I’m using https://github.com/tuist/tuist|Tuist as project generation tool and would love to use your SDK as SPM instead of cocoapods.
But, I facing an issue importing SPM module in my multi-module project, while installing SDK as it described in guide:
//...
dependencies: [
// see the latest version on <https://github.com/statsig-io/ios-sdk/releases>
.package(url: "<https://github.com/statsig-io/ios-sdk.git>", .upToNextMinor("X.Y.Z")),
],
//...
targets: [
.target(
name: "YOUR_TARGET",
dependencies: ["Statsig"]
)
],
//...
Context:
• multi module app
• tuist 3.31.2
• Struct: I have Module X
, in which I’m importing statsig SPM. This module X
imported into module Y
The problem is next:
During compilation I’m facing error, that module Y missing required module StatsigInternalObjC
, which defined as internal https://github.com/statsig-io/ios-sdk/blob/main/Package.swift#L22|dependency for you swift module. So, I’m assuming obj-c or not imported or not included into my project compilation.
For Cocoapods all works fine and as expected.
Question: Am I missing smth from guide or project setup ? Or it smth different?
Thanks in advance for help!
Anonymous: Problem is that I can’t import Statsig in all my sub-modules, which may need Statsig abstractions or module it self. Also, not sure that it’ll work. I’d prefer to keep current struct where only module X
have Statsig
imported as SPM dependency. And Obj module handled properly when X
module imported into Module Y
, A
, B
etc.
Or it’s an SPM bug or I’m doing smth wrong with my setup and need to roll-back to cocoapods usage.
So I’d grateful for help or any tips!
tore (Statsig): Hi Ivan - I think we can make this a bit easier. We’re going to remove the StatsigInternalObjC
as it is currently unused
Anonymous: Hi! Wow, it’d be nice. Do you have any ETA for that?