Comments (13)
Sure. I'll create a sample project. If it works, obviously there is something wrong in my specific project (as i have added desktop target manually into a KMM project).
from decompose.
Ignore about Koin, Hilt and multiple compose dependencies.
Initially I started the project with just Android and iOS (with native UIs).
But then started to migrate to a full KMP project slowly migrating from hilt in Android to koin in shared and jetpack compose from Android to jetbrains compose in shared.
You can already see i commented hilt implementation
Will remove hilt and Jetpack Compose eventually after migration.
from decompose.
And now regarding the actual issue,
It's only happening in desktop.
So far I tried running the desktop app by using the green triangle "Play iconβ button in the main function of desktop.
But, now I just tried running by creating a custom configuration as @JuBan1 suggested. Now it's working.
And thanks for remaining version suggestions. Since the app was working well in Android and iOS, I was expecting it to work in Desktop automatically.
And I didn't upgrade to Kotlin 1.9.10 is because, in Android Studio that version plugin is not yet available.
Regarding the sql error, this is surprising... In Android and iOS, it's working just with CREATE TABLE. Any way, I'll change it to IF NOT EXISTS and it's more fail safe.
from decompose.
Thanks for the update! Closing the issue.
from decompose.
Please see: #464
from decompose.
No luck even after adding those flags in command line options.
from decompose.
It would be nice to have a reproducer. It really looks like an issue with your environment.
from decompose.
I trimmed down my project and made this as a reproducer for you.
https://github.com/sdzshn3/DecomposeRepro
from decompose.
Thanks! Are there any specific steps to produce? I have successfully launched the desktop app via ./gradlew :desktop:run
once. Subsequent runs throw an error which looks unrelated to Decompose.
Caused by: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (table setting already exists)
at org.sqlite.core.DB.newSQLException(DB.java:1179)
at org.sqlite.core.DB.newSQLException(DB.java:1190)
at org.sqlite.core.DB.throwex(DB.java:1150)
at org.sqlite.core.NativeDB.prepare_utf8(Native Method)
at org.sqlite.core.NativeDB.prepare(NativeDB.java:126)
at org.sqlite.core.DB.prepare(DB.java:264)
at org.sqlite.core.CorePreparedStatement.<init>(CorePreparedStatement.java:46)
at org.sqlite.jdbc3.JDBC3PreparedStatement.<init>(JDBC3PreparedStatement.java:32)
at org.sqlite.jdbc4.JDBC4PreparedStatement.<init>(JDBC4PreparedStatement.java:25)
at org.sqlite.jdbc4.JDBC4Connection.prepareStatement(JDBC4Connection.java:34)
at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:226)
at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:206)
at app.cash.sqldelight.driver.jdbc.JdbcDriver.execute(JdbcDriver.kt:130)
at app.cash.sqldelight.db.SqlDriver$DefaultImpls.execute$default(SqlDriver.kt:63)
at com.omniwyse.smarttrackadmin.database.shared.SmartTrackAdminDatabaseImpl$Schema.create-0iQ1-z0(SmartTrackAdminDatabaseImpl.kt:30)
at com.omniwyse.smarttrackadmin.database.shared.SmartTrackAdminDatabaseImpl$Schema.create(SmartTrackAdminDatabaseImpl.kt:25)
at com.omniwyse.smarttrackadmin.core.data.local.SqlDriverFactoryKt.sqlDriverFactory(SqlDriverFactory.kt:10)
at com.omniwyse.smarttrackadmin.di.AppModuleKt$appModule$1$1.invoke(AppModule.kt:20)
at com.omniwyse.smarttrackadmin.di.AppModuleKt$appModule$1$1.invoke(AppModule.kt:20)
at org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:54)
... 34 more
from decompose.
As a workaround, changed the SQL statement to CREATE TABLE IF NOT EXISTS
and the app starts fine every time.
from decompose.
I launched your project for desktop and it works fine for me too. For Android I had to upgrade to Kotlin 1.9.10 due to the Compose Compiler (1.5.3) compatibility. I also had to remove the signing configuration since the configuration was otherwise invalid.
I looked into your dependencies and versions and noticed the following:
- You are adding multiple android compose dependencies to your
androidApp
, even though you don't need any of these in your example. I would let Compose Multiplatform manage the dependencies and add onlyandroidx.activity:activity-compose1.7.2
to the android module - You are using moko resources
0.23.0
, which is not compatible with Kotlin 1.9.0, the upcoming version0.24.0
will be, see icerockdev/moko-resources#575 - You are using
io.github.raamcosta.compose-destinations
, which, if I am correct, adds navigation, which should normally be handled by Decompose due to the component state management. - Koin
3.5.0.
introduced support for Kotlin 1.9.0, but you are using3.2.0
- I couldn't find any changelog that says that SQLDelight 2.0.0 is compatible yet with Kotlin 1.9.0, is it confirmed that it works?
- The compose compiler 1.5.3 requires Kotlin 1.9.10 (see https://developer.android.com/jetpack/androidx/releases/compose-kotlin#pre-release_kotlin_compatibility). It should probably work anyway, but prefer to upgrade to 1.9.10 if supported by other dependencies too
And a personal recommendation, I would not use Koin or Hilt in combination with Decompose, it will overcomplicate your project.
from decompose.
It is only when running the desktop app?
I've encountered the same runtime problem. Not with Decompose but with Ktor, and after removing Ktor something else took its place.
It's not a Decompose problem but instead a problem of how IntelliJ/Android Studio packages and runs the executable. Apparently it doesn't supply the correct class paths (?) in some cases. gradlew run
works just fine, however. My workaround was to avoid the default run configuration created by IJ and use a custom gradle configuration that executes run
instead.
I wasn't able to find a specific reason for why it happens. At first I thought it was because of a specific Android Studio version but I tested it on several machines with different results.
from decompose.
Thanks for all the useful information!
from decompose.
Related Issues (20)
- Try making the previous component in Child Stack STARTED while the predictive back animation HOT 1
- [3.0] Consider NavigationSource#subscribe to return Cancellation
- [3.0] Move PredictiveBackGestureOverlay and PredictiveBackGestureIcon inside `predictiveback` package
- [3.0] [Pages] [Crash] NullPointerException while serializing not yet created pages HOT 7
- Use adaptive components like ListDetailPaneScaffold in sample code HOT 3
- Animate predictive back cancellation HOT 3
- build gets fail when i use extensionsComposeJetbrains = "2.2.2" HOT 2
- InstanceKeeper behaviour changed from 2.1.4 to 2.2.2 to be destroyed in component graph HOT 9
- Seeking help regarding Lifecycle functions are not getting called. HOT 1
- Expand the docs on passing the parent ComponentComponent to child components HOT 1
- Investigate if we can add checks to prevent passing the parent ComponentContext to children HOT 1
- RememberSaveable lost state after process death HOT 2
- Maybe add a FAQ page to docs? HOT 1
- Navigation events are lost when navigation is performed during initialisation (first call to childFactory)
- Maintain the last remaining configuration in the stack if `popWhile` never returned `true` HOT 1
- Optimize navigation functions for performance HOT 2
- Decompose with Compose Multiplatform for Web
- Predictive back gesture is not working when started while the main animation is in progress
- Navigation animation causes content to not invalidate HOT 9
- KMP project stopped building for iOS with wasm supported decompose HOT 5
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 decompose.