Closed terrakok closed 6 days ago
I might be wrong here, but it looks like it might lead to fixing android previews with multiplatform resources (#4932, #4476) eventually... If CopyResourcesToAndroidAssetsTask is run before whatewer Android Studio does to render previews and AndroidContextProvider.ANDROID_CONTEXT is set somehow from the preview (or ContextLocal is used instead)
I checked a preview with the new packaging but it doesn't work because android assets is semi available in the preview mode. It works strange for a regular android project too: 1) Assets are not available unless you run the project first time. 2) Assets are only available in the same module where your preview is.
UPDATE: the problem is addGeneratedSourceDirectory function doesn't work with AS Compose Preview :feelsgood:
Now Android Studio Compose Preview works :godmode:
Now Android Studio Compose Preview works :godmode:
Sorry for the question, but Iam currently having these versions in my compose multiplaform project, what versions do I need to use in case of solving the preview issues in AS ?
compose-plugin = "1.6.11" androidx-compose = "1.6.8" kotlin = "1.9.23" jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" } androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "androidx-compose" } androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview", version.ref = "androidx-compose" }
The PR changes the android resources packaging. Now all resources are packed to the android assets (not only fonts). It unblocks usage android URIs to the resources in a WebView or other external resource consumers. Additionally the PR fixes Android Studio Compose Previews work with multiplatform resources:
For a backward compatibility the resources library tries to read resources in java resources if assets were not found.
Fixes https://github.com/JetBrains/compose-multiplatform/issues/4877 Fixes https://github.com/JetBrains/compose-multiplatform/issues/4503 Fixes https://github.com/JetBrains/compose-multiplatform/issues/4932 Fixes https://github.com/JetBrains/compose-multiplatform/issues/4476 Fixes https://github.com/JetBrains/compose-multiplatform/issues/3828
Release Notes
Features - Resources