Tin Pham
06/01/2023, 10:43 PMshared
(using our current template).
1 - If I tried to add
val commonMain by getting {
dependencies {
...
implementation(compose.uiTooling)
implementation(compose.preview)
}
}
(where the resources
folder currently located: shared/commonMain/resources/...
)
When sync w gradle, I got error:
A problem occurred configuring project ':shared'.
> Could not resolve all dependencies for configuration 'sharediosArm64CompileKlibraries'.
> Could not resolve org.jetbrains.compose.uiui tooling1.4.0.
Required by:
project :shared
> No matching variant of org.jetbrains.compose.uiui tooling1.4.0 was found. The consumer was configured to find a usage of 'kotlin-api' of a library, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native', attribute 'org.jetbrains.kotlin.native.target' with value 'ios_arm64' but: ...2 - I figured, probably I can only preview in Android-specific code, so I tried to specify in
androidMain
val androidMain by getting {
dependencies {
...
implementation(compose.uiTooling)
implementation(compose.preview)
}
}
Sync w gradle is ok, but then IDE didn't recognize the resources
Render problem: org.jetbrains.compose.resources.MissingResourceException: Missing resource with path: icon/ic_google_logo.xml at layoutlib.internal.kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith ...3 - So I tried in
androidApp
module and duplicate resources
folder, but it still can't recognize.
iOS/Android apps still compiled and ran normal, but just no preview (Not big deal, but I thought it may be better if I can preview in realtime in shared
module w/o duplicating resources everywhere). Thanks a lot for your all times in advance.Adrian Witaszak
06/02/2023, 7:57 AMOleksandr Karpovich [JB]
06/02/2023, 8:51 AMimplementation(compose.preview)
this preview is currently available only for desktop.
android has its own preview from jetpack compose.
other platforms don't have a preview for now.
Isn't the tooling only for Android and Deskotop?That's right - https://github.com/JetBrains/compose-multiplatform-core/blob/jb-main/compose/ui/ui-tooling/build.gradle#L68
Joel Denke
06/02/2023, 11:44 AMOleksandr Karpovich [JB]
06/02/2023, 1:10 PMCicero
06/05/2023, 7:11 PMCicero
06/05/2023, 7:11 PMOleksandr Karpovich [JB]
06/09/2023, 8:33 AMCicero
06/09/2023, 8:03 PM