Comments (8)
Hi, PreCompose is targeting jvm 11, you can upgrade to jvm 11 if you're targeting jvm 1.8.
from precompose.
this is common gradle code
how can i upgrade jvm?
plugins {
kotlin("multiplatform")
id("org.jetbrains.compose")
id("com.android.library")
}
group = "com.ainoapp.aino"
version = "1.0-SNAPSHOT"
kotlin {
android()
jvm("desktop") {
jvmToolchain(11)
}
sourceSets {
val commonMain by getting {
dependencies {
api(compose.runtime)
api(compose.foundation)
api(compose.material)
api(compose.material3)
api(compose.ui)
//api(compose.animation)
api("moe.tlaster:precompose:1.4.1")
api("moe.tlaster:precompose-viewmodel:1.4.1")
//val ktorVersion = "2.3.0"
//implementation ("io.ktor:ktor-client-okhttp:$ktorVersion")
//implementation ("io.ktor:ktor-client-content-negotiation:$ktorVersion")
//implementation ("io.ktor:ktor-serialization-gson:$ktorVersion")
//implementation ("io.ktor:ktor-client-logging:$ktorVersion")
//implementation "ch.qos.logback:logback-classic:1.4.4"
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val androidMain by getting {
dependencies {
api("androidx.appcompat:appcompat:1.6.1")
api("androidx.core:core-ktx:1.10.0")
}
}
val androidInstrumentedTest by getting {
dependencies {
implementation("junit:junit:4.13.2")
}
}
val desktopMain by getting {
dependencies {
api(compose.preview)
}
}
val desktopTest by getting
}
}
android {
compileSdk = 33
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/commonMain/resources", "src/androidMain/resources")
defaultConfig {
minSdk = 24
targetSdk = 33
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
from precompose.
Like this, by default kotlin is targeting jvm 1.8
from precompose.
I copy this code and paste to allprojects
tag but it still didn't work :'(
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
// allWarningsAsErrors = true
freeCompilerArgs = listOf(
"-opt-in=kotlin.RequiresOptIn",
)
}
}
from precompose.
https://github.com/mahramane/demo2
this is a sample project
from precompose.
Are you using jdk 11+ as your development environment? When targeting jvm 11 it requires jdk 11+ as development environment.
And I found some setup is not done yet in sample project and might cause crash, like PreCompose require using moe.tlaster.precompose.PreComposeWindow
for desktop(jvm) and moe.tlaster.precompose.lifecycle.PreComposeActivity
for Android, for more setup guide: here
from precompose.
Yes i use JDK11.
I know about PreComposeWindow
I just create a sample project for you to show the path
error before run project, do you download that?
Sorry for taking up your time, your library is great ♥
from precompose.
Yes, I do clone the project, and it works ok on my machine, can you confirm that java --version
shows jdk11? or if you're using intellij/Android studio, make sure you're using jdk11 in project structure.
from precompose.
Related Issues (20)
- how can i use ViewModel like android in desktop module? HOT 1
- [BUG] rememberNavigator returns different instances inside and outside of NavHost HOT 3
- Very high memory usage on ios when upgrading to 1.6.0 HOT 2
- [BUG] 1.6.0-rc03 快速场景跳转没问题了,但随之而来的是,android端的返回键不能返回了 HOT 2
- Back animations sped up + stop working when interrupted in the middle HOT 2
- Support for Google's Viewmodel which recently went multi-platform HOT 5
- [BUG] [Android] NavHost launching the initial route twice! HOT 4
- Can I use bottom navigation in precompose? HOT 5
- [BUG] koinViewModel in precompose-koin not consistent across platform HOT 7
- [BUG] 按下系统的返回键,在过渡动画结束前快速连按返回键,会无限重复这个过渡动画,直到我手速没跟上 HOT 1
- [BUG] ViewModel onCleared never called and viewModelScope is never cancelled HOT 2
- [BUG] spaceToSwipe wasn't changing anything HOT 2
- ViewModel cached for same compose funtions HOT 4
- [Feature request] Expose AnimatedContentScope driving the animations into individual screens HOT 6
- [BUG] Nested Navigation Group with Bottom Navigation HOT 1
- [BUG] ModalBottomSheet with nested NavHost breaks the Composition HOT 2
- [BUG] ModalBottomSheet NavHost animateContentSize issues HOT 3
- [BUG] Rapid back navigation breaks layout on Android HOT 2
- [BUG] Precompose 1.6.0 pulls androidx.compose.ui:ui-test-junit4-android in the runtime classpath HOT 1
- Navigating is losing Screen state HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from precompose.