terrakok / compose-multiplatform-wizard Goto Github PK
View Code? Open in Web Editor NEWCompose Multiplatform Wizard
Home Page: https://terrakok.github.io/Compose-Multiplatform-Wizard/
License: MIT License
Compose Multiplatform Wizard
Home Page: https://terrakok.github.io/Compose-Multiplatform-Wizard/
License: MIT License
When creating a project with the WASM target enabled, the Gradle configuration cache is turned on in gradle.properties:
org.gradle.jvmargs=-Xmx4G -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx4G"
org.gradle.caching=true
org.gradle.configuration-cache=false
Support for the the configuration cache was added only in Kotlin 2.0.0-Beta4: https://youtrack.jetbrains.com/issue/KT-64851.
A as a result, build of the default generated project fails with an error:
> Configure project :composeApp
New 'wasm' target is Work-in-Progress and is subject to change without notice.
21 problems were found storing the configuration cache, 8 of which seem unique.
…
At least having commonTest or mobile test would be nice, and if users want to add more, they can copy the code. Alternatively, it can be an option to add in the wizard.
It would be nice to include kotlin inject as an additional option for dependency injection.
like this repo :
https://github.com/SEAbdulbasit/MusicApp-KMP
i think this is better
build error
Build file '/Users/lingkotang/compose/Compose-Multiplatform-Wizard-App/build.gradle.kts' line: 1
Plugin [id: 'org.jetbrains.kotlin.multiplatform', version: '1.8.20', apply: false] was not found in any of the following sources:
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Could you please add "org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5" to the list of components. I think using immutable types in compose is very important and this is one of the standard kotlinx packages anyway, so it should not be missing.
I was a little surprised when I did not find Compose in the source 😄
This wizard produce this when android and ios is the target:
composeApp
- androidMain
- iosMain
- commonMain
iosApp
Notice no androidApp
outside the composeApp
and this not ideal because a dedicated androidApp
project folder is useful for many reasons, including, having separate debug resource for debug app, alternative implementation for debug app (e.g. AndroidManifest file) etc.
Is there any plan to bring back androidApp
folder?
JDK 1.8 is outdated.
Here I have a PR
for it #31
I am trying to add Microsoft SSO login to my app, but it requires editing the Info.plist to add a redirect URL. There is no Info.plist in the iosApp folder generated by your amazing tool (that I use constantly). How can I accomplish this?
i can't run on ios device from xcode... this error message are thrown.
Could not find "co.touchlab:stately-common" in [/Users/md.asifparvez/Shohrab/PureMind/Muslim, /Users/md.asifparvez/.konan/klib, /Users/md.asifparvez/.konan/kotlin-native-prebuilt-macos-aarch64-1.9.21/klib/common, /Users/md.asifparvez/.konan/kotlin-native-prebuilt-macos-aarch64-1.9.21/klib/platform/ios_simulator_arm64]
Hi.
Please, add support room and viewModel dependencies at this wizard. They have multiplatform realisation.
Thx
First of all thanks a bunch for this wizard! It has made my life so much easier ⭐ It's great to see it growing both in features and popularity.
I can observe that the wizard has only one option for the navigation library (i.e. Voyage) whereas we can see there are multiple options for some other kinds of libraries (like DI that contains Koin and Kodein), therefore, here's another option for the Navigation
category, it's called PreCompose
:
https://github.com/Tlaster/PreCompose
It's perfect for users who are coming to KMP/CMP from the Android (Jetpack Compose) world, the API is very similar to Android thereby making the learning curve almost negligible.
Do consider checking it out and if it fits the description, then adding it in the wizard as well 👍
Will be there a need for this Wizard
also support Backend - KTOR
?
See:
https://kotlinlang.slack.com/archives/C3PQML5NU/p1695488286979129
https://hlnstepanova.github.io/kmpizza/step-2-add-a-backend-module/
Please add moko resources dependencies option also, it's somewhat tricky with version catalogues
I would greatly appreciate instructions in the README (and a Gradle command) for each platform on how to create a distributable/executable, not just how to run it in debug. Thank you so much!
Go to https://terrakok.github.io/Compose-Multiplatform-Wizard/
Create the project with default parameters
Run the Android target:
We can see that background is dark, but it shoud be white, as in the other targets.
The phone itself has the Light theme:
The reason is
android:theme="@android:style/Theme.Material.NoActionBar"
it needs to be
android:theme="@android:style/Theme.Material.Light.NoActionBar"
as in the official Compose Multiplatform template and in official Android template from Android Studio Giraffe | 2022.3.1 Patch 1
.
The official Jetpack Compose also creates dynamic changing of the theme (but still has Theme.Material.Light.NoActionBar):
private val DarkColorScheme = darkColorScheme(
primary = Purple80,
secondary = PurpleGrey80,
tertiary = Pink80
)
private val LightColorScheme = lightColorScheme(
primary = Purple40,
secondary = PurpleGrey40,
tertiary = Pink40
/* Other default colors to override
background = Color(0xFFFFFBFE),
surface = Color(0xFFFFFBFE),
onPrimary = Color.White,
onSecondary = Color.White,
onTertiary = Color.White,
onBackground = Color(0xFF1C1B1F),
onSurface = Color(0xFF1C1B1F),
*/
)
@Composable
fun MyApplicationTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
// Dynamic color is available on Android 12+
dynamicColor: Boolean = true,
content: @Composable () -> Unit
) {
val colorScheme = when {
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
val context = LocalContext.current
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
}
darkTheme -> DarkColorScheme
else -> LightColorScheme
}
val view = LocalView.current
if (!view.isInEditMode) {
SideEffect {
val window = (view.context as Activity).window
window.statusBarColor = colorScheme.primary.toArgb()
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
}
}
MaterialTheme(
colorScheme = colorScheme,
typography = Typography,
content = content
)
}
I suggest to keep the version of coroutines at 1.6.4 because for now Ktor 2.3.0 and coroutines 1.7.1 doesn't work together, I think that we need to wait until a new Ktor update
When I create a template with Android, iOS, JS and MacOS enabled and build JS target from README.md
I get an empty JS file.
It has only exports
and some other declarations but not the sample getFibonacciNumbers2
function.
Please advise.
Thanks for this wonderful MPP generator.
Had a small request if you could possibly add the option of choosing in iOS between CocoaPods and Regular framework as well.
I could possibly work on this as well, if you want
I just saw there are some more Moko LIBs for the MVVM maybe it make sense to add all of theme ? when select Moke MVVM ?
Or is better for each a own box in the Wizard
?
https://github.com/icerockdev/moko-mvvm
commonMainApi("dev.icerock.moko:mvvm-core:0.16.1") // only ViewModel, EventsDispatcher, Dispatchers.UI
commonMainApi("dev.icerock.moko:mvvm-flow:0.16.1") // api mvvm-core, CFlow for native and binding extensions
commonMainApi("dev.icerock.moko:mvvm-livedata:0.16.1") // api mvvm-core, LiveData and extensions
commonMainApi("dev.icerock.moko:mvvm-state:0.16.1") // api mvvm-livedata, ResourceState class and extensions
commonMainApi("dev.icerock.moko:mvvm-livedata-resources:0.16.1") // api mvvm-core, moko-resources, extensions for LiveData with moko-resources
commonMainApi("dev.icerock.moko:mvvm-flow-resources:0.16.1") // api mvvm-core, moko-resources, extensions for Flow with moko-resources
// compose multiplatform
commonMainApi("dev.icerock.moko:mvvm-compose:0.16.1") // api mvvm-core, getViewModel for Compose Multiplatfrom
commonMainApi("dev.icerock.moko:mvvm-flow-compose:0.16.1") // api mvvm-flow, binding extensions for Compose Multiplatfrom
commonMainApi("dev.icerock.moko:mvvm-livedata-compose:0.16.1") // api mvvm-livedata, binding extensions for Compose Multiplatfrom
androidMainApi("dev.icerock.moko:mvvm-livedata-material:0.16.1") // api mvvm-livedata, Material library android extensions
androidMainApi("dev.icerock.moko:mvvm-livedata-glide:0.16.1") // api mvvm-livedata, Glide library android extensions
androidMainApi("dev.icerock.moko:mvvm-livedata-swiperefresh:0.16.1") // api mvvm-livedata, SwipeRefreshLayout library android extensions
androidMainApi("dev.icerock.moko:mvvm-databinding:0.16.1") // api mvvm-livedata, DataBinding support for Android
androidMainApi("dev.icerock.moko:mvvm-viewbinding:0.16.1") // api mvvm-livedata, ViewBinding support for Android
commonTestImplementation("dev.icerock.moko:mvvm-test:0.16.1") // test utilities
Console log:
Uncaught TypeError: t.generate is not a function
<anonymous> App.kt:189
React 16
Ne
Be
Ir
Ir
Lr
Ur
cs
ze
Ur
qt
Vt
Dr
Fr
Wr
Wr
createRoot
r Main.kt:18
r App.kt:22
6393 App.kt:22
Webpack 5
o
<anonymous>
<anonymous>
<anonymous>
<anonymous>
App.kt:189:34
<anonymous> App.kt:189
React 14
forEach self-hosted:4497
React 2
r Main.kt:18
r App.kt:22
6393 App.kt:22
Webpack 5
o
<anonymous>
<anonymous>
<anonymous>
<anonymous>
When generating a project, Gradle version 8.7 is added to gradle.properties:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
But Gradle Wrapper files of some older version are used (gradlew, gradlew.bat, gradle/wrapper/gradle-wrapper.jar).
After generating the project, you need to manually run ./gradlew wrapper --gradle-version=8.7
to update the wrapper, it would be nice if it was updated when generated.
The AGP version is too high for Android Studio Giraffe. The current supported version is 8.1 but the version provided in the wizard is 8.1.0-alpha04. It would be nice to have a drop down to select what Android Studio the user is using or possibly a checkbox for restricting to stable builds.
This tool is very good, i wish i could use it natively in Android Studio.
Hi
I put code at generated project:
@Composable
@Preview(showBackground = true, showSystemUi = true)
fun Pr() {
App()
}
in App.android.kt
when I open preview window i see error:
org.jetbrains.compose.resources.MissingResourceException: Missing resource with path: composeResources/multiplatform_app.composeapp.generated.resources/values/strings.commonMain.cvr at _layoutlib_._internal_.kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith ... (ContinuationImpl.kt:33) at _layoutlib_._internal_.kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) at _layoutlib_._internal_.kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:277) at _layoutlib_._internal_.kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95) at _layoutlib_._internal_.kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69) at _layoutlib_._internal_.kotlinx.coroutines.BuildersKt.runBlocking at _layoutlib_._internal_.kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:48) at _layoutlib_._internal_.kotlinx.coroutines.BuildersKt.runBlocking$default at org.company.app.ComposableSingletons$AppKt$lambda-2$1.invoke ... (App.kt:31) at org.company.app.ComposableSingletons$AppKt$lambda-2$1.invoke(App.kt:22) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.material3.SurfaceKt$Surface$1.invoke(Surface.kt:134) at androidx.compose.material3.SurfaceKt$Surface$1.invoke(Surface.kt:115) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228) at androidx.compose.material3.SurfaceKt.Surface-T9BRK9s(Surface.kt:112) at org.company.app.theme.ThemeKt$AppTheme$1$1.invoke(Theme.kt:89) at org.company.app.theme.ThemeKt$AppTheme$1$1.invoke(Theme.kt:89) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:248) at androidx.compose.material3.TextKt.ProvideTextStyle(Text.kt:352) at androidx.compose.material3.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:72) at androidx.compose.material3.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:71) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228) at androidx.compose.material3.MaterialThemeKt.MaterialTheme(MaterialTheme.kt:64) at org.company.app.theme.ThemeKt$AppTheme$1.invoke(Theme.kt:87) at org.company.app.theme.ThemeKt$AppTheme$1.invoke(Theme.kt:84) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:248) at org.company.app.theme.ThemeKt.AppTheme(Theme.kt:82) at org.company.app.AppKt.App(App.kt:22) at org.company.app.App_androidKt.Pr(App.android.kt:45) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:568) at androidx.compose.ui.tooling.ComposableInvoker.invokeComposableMethod(ComposableInvoker.jvm.kt:181) at androidx.compose.ui.tooling.ComposableInvoker.invokeComposable(ComposableInvoker.jvm.kt:221) at androidx.compose.ui.tooling.ComposeViewAdapter$init$3$1$composable$1.invoke(ComposeViewAdapter.android.kt:504) at androidx.compose.ui.tooling.ComposeViewAdapter$init$3$1$composable$1.invoke(ComposeViewAdapter.android.kt:502) at androidx.compose.ui.tooling.ComposeViewAdapter$init$3$1.invoke(ComposeViewAdapter.android.kt:539) at androidx.compose.ui.tooling.ComposeViewAdapter$init$3$1.invoke(ComposeViewAdapter.android.kt:497) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228) at androidx.compose.ui.tooling.InspectableKt.Inspectable(Inspectable.android.kt:61) at androidx.compose.ui.tooling.ComposeViewAdapter$WrapPreview$1.invoke(ComposeViewAdapter.android.kt:444) at androidx.compose.ui.tooling.ComposeViewAdapter$WrapPreview$1.invoke(ComposeViewAdapter.android.kt:443) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228) at androidx.compose.ui.tooling.ComposeViewAdapter.WrapPreview(ComposeViewAdapter.android.kt:438) at androidx.compose.ui.tooling.ComposeViewAdapter.access$WrapPreview(ComposeViewAdapter.android.kt:124) at androidx.compose.ui.tooling.ComposeViewAdapter$init$3.invoke(ComposeViewAdapter.android.kt:497) at androidx.compose.ui.tooling.ComposeViewAdapter$init$3.invoke(ComposeViewAdapter.android.kt:494) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.ui.platform.ComposeView.Content(ComposeView.android.kt:428) at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:252) at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:251) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228) at androidx.compose.ui.platform.CompositionLocalsKt.ProvideCommonCompositionLocals(CompositionLocals.kt:186) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:119) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:118) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.ProvideAndroidCompositionLocals(AndroidCompositionLocals.android.kt:110) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$2.invoke(Wrapper.android.kt:139) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$2.invoke(Wrapper.android.kt:138) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:248) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:138) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:123) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:90) at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3302) at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:3235) at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:725) at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:1071) at androidx.compose.runtime.CompositionImpl.composeInitial(Composition.kt:633) at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:619) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:123) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:114) at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.android.kt:1289) at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.android.kt:114) at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.android.kt:164) at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.kt:314) at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.kt:192) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:121) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:114) at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:1364) at android.view.View.dispatchAttachedToWindow(View.java:21980) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3490) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:44)
How can I fix this problem?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.