AmrJyniat
03/20/2023, 12:48 PM.xml
files between Android&IOS?rudolf.hladik
03/20/2023, 1:05 PMEvegenii Khokhlov
03/20/2023, 1:35 PMAmrJyniat
03/20/2023, 1:37 PMshape
xml file, can I share it with IOS?Evegenii Khokhlov
03/20/2023, 1:42 PMAhmad Hassan
03/20/2023, 5:29 PMEvegenii Khokhlov
03/20/2023, 5:33 PMSam
03/21/2023, 12:42 AMresources
approach to work without errors, but I found what to me is a simpler approach that also hits up against fewer naming convention issues.
I also mostly just put things like images in each platform project separately, but for what files I do share, I use Android "assets" rather than "resources". I use this to share some JSON files. Obviously this won't work for anything where e.g. Android requires an XML resource, but for files you just read at runtime, it works great.
I have a folder shared/src/commonMain/assets
and then the following config:
kotlin {
cocoapods {
extraSpecAttributes.apply {
this["resources"] = "'src/commonMain/assets/**/*'"
}
}
}
android {
sourceSets {
named("main") {
assets.srcDir("src/commonMain/assets")
}
}
}
Konstantin Tskhovrebov
03/21/2023, 9:05 AM