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

Arkadii Ivanov

01/22/2020, 2:29 PM
How to use Android resources in an
androidMain
source set? I tried both
res
and
resources
folder names, the last one seems recognized but resources are not accessible (nor from the code or from e.g. layouts).
k

Kris Wong

01/22/2020, 2:31 PM
did you set the resource
srcDir
on the Android plugin?
a

Arkadii Ivanov

01/22/2020, 2:32 PM
Perhaps no, is there a documentation?
k

Kris Wong

01/22/2020, 2:34 PM
Copy code
android {
    sourceSets {
        getByName("main") {
            manifest.srcFile("src/androidMain/AndroidManifest.xml")
            java.srcDirs("src/androidMain/kotlin")
            res.srcDirs("src/androidMain/res")
        }
a

Arkadii Ivanov

01/22/2020, 2:37 PM
Wow, thank you so much, it works
🍻 2
4 Views