Hi. I'm trying to use allDrawableResources as part...
# amper
r
Hi. I'm trying to use allDrawableResources as part of KMP, but that seems to only work with Gradle build, not Amper build. See https://youtrack.jetbrains.com/issue/CMP-4880 and https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-multiplatform-resources-usage.html#compose-multiplatform-resources-as-android-assets. Any pointer here? Is that a missing feature, should I add a ticket in Youtrack?
f
Hi! The feature is implemented. Can you share what specifically doesn't work as expected? Btw, if you are trying to access these resource maps from another module, then
settings: compose: resources: exposedAccessors: true
must be set, so that generated accessors are public, not internal.
r
I mean the
Res.allDrawableResources
is not generated, and thus can't be imported:
Unresolved reference 'allDrawableResources'
. Single module, so this isn't related to
exposedAccessor
(I enabled the option nonetheless, but that didn't change anything). Only the resources map is not generated, "basic" resources are generated correctly.
f
I see, thanks for clarifying. What version of Amper are you using?
r
This happens with 0.7.0 as well as the latest 0.8.0-dev-2918 build.
f
Reproduced the issue in a project with resources in a single application module. So, yes, it's a bug, Thanks for the report! We'll fix it and the fix will be available in the dev version.
👍 1
If your application module is android or jvm app, you can technically temporarily work around the issue by placing your sources into
src@android
,
src@jvm
directories instead of
src
until the fix is available. For iOS apps the bug should not reproduce, afaik.
r
Thank you! Glad to be of help.