Open Deorigami opened 4 weeks ago
@Deorigami Thanks for your feedback! It seems that Kotlin 2.0 does not allow the custom resource folder. However, to make HTML files packaged to each platform correctly, we must create that 'assets' folder under composeResoruces. I will contact JetBrains for a solution.
Even on Compose v1.6.2 this seems to be the case? I am getting the same error when I placed assets folder inside composeResources
to store my HTML file.
GenerateResClassTask was failed:
java.lang.IllegalStateException: Unknown resource type: 'assets'.
@msasikanth @Deorigami I apologize for the inconvenience caused by this issue. I have submitted this issue to JetBrains for an official solution. One temporary solution could be to create a resources
folder like we did before version 1.6.0 and place the assets
folder under it. Please let me know if you encounter any further issues.
@msasikanth @Deorigami I apologize for the inconvenience caused by this issue. I have submitted this issue to JetBrains for an official solution. One temporary solution could be to create a
resources
folder like we did before version 1.6.0 and place theassets
folder under it. Please let me know if you encounter any further issues.
I tried to place it in resources/assets
, but it didn't get packaged to the final APK. So, this seems to be an issue even with 1.6.2 Compose as well?
@msasikanth Did you place the resources/assets
under commonMain? It works fine on my side? Which platforms are you running on?
I did. Maybe I missed on something on Gradle configuration to tell Android SDK about this folder as the resources as well.
When I compiled, I could see the assets
folder, but it only contained the Compose resources font directory.
I compiled it on MacOS BTW
This is what I have
It's just missing the Gradle sourceset configuration. Once I add this, it's working now. Sorry about that
sourceSets["main"].resources.srcDirs("src/commonMain/resources")
@KevinnZou hey there, after i put the assets into commonMain/resources/assets .. throwing this error now
Entry assets/new_map.html is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/8.4/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.
this error occurs when i put sourceSets["main"].resources.srcDirs("src/commonMain/resources") .. if i remove this. it compiled .. but the xml is not shown
(ComposeWebView) WebView Loading Failed with error: The requested URL was not found on this server. (ComposeWebView) didFailNavigation
@Deorigami Did you also place new_map.html
in other place? It seems that you have duplicate files.
no i dont .. for now i cannot load any Html file .. but im able to load the file from composeResource and make it a string, so i have to dump all of my Html + Js code inside 1 file.
WIll be nice if we can separate the file like it used to
Currently im using Kotlin 2.0.0-RC2, i take a look onto you samples using new resources plugin and i cant create assets folder inside composeResources to store my html file the compilation error says:
> Task :app_core:generateResourceAccessorsForCommonMain FAILED e: generateResourceAccessorsForCommonMain task was failed: java.lang.IllegalStateException: Unknown resource type: 'assets'.