Closed KevinnZou closed 1 month ago
For multiplatform resources you are supposed to use https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-images-resources.html
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Describe the bug In my project https://github.com/KevinnZou/compose-webview-multiplatform. It has a
webview
module and a sample module depending on thewebview
module. I implemented a logic in thewebview
module that will read the HTML file under the resources folder and load it by Webview.Then, I placed an
index.html
file under thesample/shared/commonMain/resources
folder and called that method from the sample module. It works well on the Desktop and iOS platforms but failed on Android with the error:org.jetbrains.compose.resources.MissingResourceException: Missing resource with path: index.html
It works if I also create a
index.html
file under thewebview/commonMain/resources
folder. However, it is impossible for developers to place their resource files under my library folder. Webview module will be published as a dependency and need to read the resource under the host project's resources folder.Affected platforms Select one of the platforms below:
Versions
To Reproduce Steps and/or the code snippet to reproduce the behavior:
Expected behavior
index.html
file under thesample/shared/commonMain/resources
should be loaded successfullyAdditional context Full Stacktrace: