Hi there
We have a modular app with a complex deps graph.
We heavily depend on multiple Google Maps packages (static, seems very hard to make them dynamic) in multiple modules (dynamic frameworks). Of course, we’re trying to avoid duplicated symbols (as it’s a proven source of crashes).
To achieve this, I created a dynamic framework that depends on all static frameworks/libs, and I’m adding it as a dependency to all modules that depend on Google Maps deps.
Let’s say
- I have two modules (dynamic frameworks)
A
andB
MapsDependencies
dynamic frameworks only embedsC
that is static
I would have expected that:
A -> B
B -> MapsDependencies
MapsDependencies -> C
would make C
content available to A
and B
(using implicit deps).
But in fact, there are compilation issues when using C
symbols in A
in this configuration.
So I tried:
A -> B
A -> MapsDependencies
B -> MapsDependencies
MapsDependencies -> C
Compilation goes through but it results in duplicated symbols at runtime .
According to the console, it seems there are multiple instances of MapsDependencies (even though it’s a dynamic framework).
objc[47444]: Class CADPComplianceRoot is implemented in both /SomePath/MapsDependencies.framework/MapsDependencies (0x116d3d320) and /SomePath/MapsDependencies.framework/MapsDependencies (0x116d49c10). One of the two will be used. Which one is undefined.
I also tried to make GMaps frameworks dynamic but then it seems they won’t find each other properly. On build time, there are some not found symbols.
All of that raises some questions:
- For my understanding:
a. does usingC
symbols inA
andB
make it a dependency of each of them, causing the duplication ofC
inA
andB
b. OR is havingC
only available fromMapsDependency
the only source of duplication? - Most importantly on the short term: how can I make GMaps static frameworks available in multiple related dynamic frameworks without duplication issues? Is my only option wrapping and hiding
C
symbols inside classes that I would make dynamically available fromMapsDependencies
?
Context
- Tuist version: 4.17.0
- Here is a graph of all GMaps deps we need