Open Deaths-Door opened 1 year ago
hi.
to resolve unresolved imports
you should add dependency as described in readme. check samples.
reason of not generated strings only that plugin not see resources that he search. compare your config with samples.
https://github.com/icerockdev/moko-resources/blob/master/samples/resources-gallery/mpp-library/build.gradle.kts https://github.com/icerockdev/moko-resources/blob/master/samples/resources-gallery/mpp-library/src/commonMain/resources/MR/base/strings.xml
Thank you , i forgot to add moko.resources to my common module and after that a clean was needed to solve my issue and generate the strings , also what exactly is the purpose of the resources-compose module , as we can already get the string via the base module , is there any specific use case for the resources-compose module ? Also is there a way to get the string localized in commonMain instead of platform specific impl
resources-compose
module have @Composable
s for compose-multiplatform.
you can't get localized string in commonMain
because for android resources reading require Context
.
if you use compose multiplatform you can use stringResource
in commonMain
- Context
will be readed in actual
android implementation from LocalContext
Jetpack Compose Resources removed this limitation and allows to read strings from common-code.
I have got in module build.gradle
and in the root build.gradle
and also in commonMain/resources/MR/base.xml which is same as default one in doc . The build tasks runs but doesn't generate strings and in the generated files the dev.icerock.moko.... import is unresolved which leads to unable to build and run the project , how do i fix this , i followed the tutorial but i get this error