compose.desktop{application{mainClass="MainKt"nativeDistributions{targetFormats(TargetFormat.Dmg,TargetFormat.Msi,TargetFormat.Deb,TargetFormat.Exe)packageName="multim-gui"packageVersion="1.0.0"}}} jdk.accessibilityを追加します。他にも追加しなければいけないものがある場合もあると思うので適宜追加し...
or java { toolchain { vendor = JvmVendorSpec.JETBRAINS languageVersion = JavaLanguageVersion.of(17) } } Compose Desktop Gradle Plugin should pack dists with the JDK home declared in toolchain instead of the default JAVA_HOME, some libs may depend on JetBrains JDK 👀 2 Gooole...
然后点击同步Gradle,打开MainActivity.kt文件,使用协程调用suspend fun greeting() import androidx.compose.runtime.*import kotlinx.coroutines.launch classMainActivity:ComponentActivity(){override funonCreate(savedInstanceState:Bundle?){super.onCreate(savedInstanceState)setContent{MyApplicationTheme{Surface(modifie...
优雅地在 Compose Multiplatform ( Android / JVM Desktop ) 中完成数据持久化 //booleanExample 初始化值为 false//之后会自动读取本地数据varbooleanExample by rememberDataSaverState("KEY_BOOLEAN_EXAMPLE",false)//直接赋值即可完成持久化booleanExample=true ...
1、单平台Desktop目录介绍 创建一个单平台的Desktop项目,项目目录如下: 在jvmMain目录下面编写我们的窗口代码,build.gradle.kts文件中,我们需要在sourceSets的jvmMain中添加我们的三方库依赖: sourceSets { val jvmMain by getting { dependencies { // 增加其他依赖库 implementation(compose.desktop.currentOs) } } ...
点击Sync Now同步Gradle之后,我们创建一个RocketLaunch.kt: import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable data classRocketLaunch(@SerialName("flight_number")val flightNumber:Int,@SerialName("name")val missionName:String,@SerialName("date_utc")val launchDate...
when I'm trying to run the application on Android I'm receiving this error, while on the JVM everything is working correctly. I have to mention when substituting importsandroidx.compose.foundation.lazy.LazyVerticalGridon android is working but on the desktop is crashing because it is the wron...
JDK (for desktop issues): java 18.0.2.1 Additional context I tried just build a simple iOS app in xCode, it works fine. I checked kdoctor, it says fine. I changed ios simulator several versions, it works fail. I updated macOS version, it works fail. I updated xCode to 14.3.1, it ...