https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
r

ribesg

03/20/2019, 10:38 AM
Hi, we have a dependency problem with our iOS target
The headers of the Framework produced by the MPP iOS App Project are invalid, they contain duplicated information
g

gonzooin

03/20/2019, 10:42 AM
r

ribesg

03/20/2019, 10:43 AM
The MPP iOS App Project `export`s both projects A and B. Projects Y, A and B have
kotlinx.serialization
and
ktor
as dependencies.
👍 1
d

Dico

03/20/2019, 10:48 AM
I think this would be better asked in #kotlin-native
s

svyatoslav.scherbina

03/20/2019, 10:49 AM
Will be fixed in 1.3.30
👌 3
r

ribesg

03/20/2019, 10:51 AM
@svyatoslav.scherbina is it fixed in the latest eap?
s

svyatoslav.scherbina

03/20/2019, 10:56 AM
Yes. Btw, why do you find headers containing duplicated information?
r

ribesg

03/20/2019, 10:57 AM
Well that’s the whole issue, and you just said it’s fixed, so I don’t understand your question
XCode refuses to compile stating that the framework is invalid, and shows what @gonzooin screenshoted above when opening the header file of the Framework.
s

svyatoslav.scherbina

03/20/2019, 11:04 AM
The compilation error from this screenshot is fixed in 1.3.30.
r

ribesg

03/20/2019, 11:07 AM
Ok, thanks for the confirmation. We’ll start migration to 1.3.30 EAP then. Do you have an issue number we can follow?
s

svyatoslav.scherbina

03/20/2019, 11:15 AM
Do you have an issue number we can follow?
What do you mean?
We’ll start migration to 1.3.30 EAP then
Alternatively you can prevent exporting
JsonPrimitive
to framework headers and continue using 1.3.2*.
r

ribesg

03/20/2019, 11:17 AM
I mean that this issue should have been reported somewhere like on https://youtrack.jetbrains.net/ but I can’t find it
@svyatoslav.scherbina I can’t find any docs on how to prevent exporting something referenced by a library I export
s

svyatoslav.scherbina

03/20/2019, 11:38 AM
Do you export
kotlinx.serialization
explicitly, like you do with project
A
?
r

ribesg

03/20/2019, 11:41 AM
We never explicitely export
kotlinx.serialization
,
ktor-client
or any other lib
We only
export
Projects X, A and B in the MPP iOS App Project, we don’t export any other lib. Just 3
export
calls
We have
kotlinx.serialization
as a dependency of a lot of project but it’s never exported using the
export
function as the MPP iOS App Project is the only one creating a Framework
@svyatoslav.scherbina so what should we do?
s

svyatoslav.scherbina

03/20/2019, 2:09 PM
If you don’t use
transitiveExport
in Gradle, then
JsonPrimitive
class is exported because it is used in public API. Please inspect your header to locate public API which brings
JsonPrimitive
to the header.
r

ribesg

03/20/2019, 2:35 PM
@svyatoslav.scherbina we’re exposing a
val
of type
KotlinxSerializer.() -> Unit
in an
object
. Would that cause
JsonPrimitive
to be exported somehow? It’s the only thing we found
There is no direct reference to
JsonPrimitive
in any of those project, public or not
s

svyatoslav.scherbina

03/20/2019, 2:38 PM
Please inspect your header instead of projects.
r

ribesg

03/20/2019, 2:57 PM
Ok, we found it. We have a reference to
Json
is a public API, which references
JsonElement
, which references
JsonPrimitive
We will need this reference in the future but not right now, so I guess it’ll have to wait for 1.3.30
👍 1