adrielcafe / voyager

🛸 A pragmatic navigation library for Jetpack Compose
https://voyager.adriel.cafe
MIT License
2.59k stars 137 forks source link

Multiplatform seems to break Android builds. #34

Closed Tolriq closed 2 years ago

Tolriq commented 2 years ago
> Could not resolve all artifacts for configuration ':modules:ui-bottomsheet-displayconfiguration:debugRuntimeClasspath'.
   > Could not find org.jetbrains.compose.runtime:runtime:1.0.1-rc2.
     Required by:
         project :modules:ui-bottomsheet-displayconfiguration > cafe.adriel.voyager:voyager-core:1.0.0-beta14 > cafe.adriel.voyager:voyager-core-android-debug:1.0.0-beta14
         project :modules:ui-bottomsheet-displayconfiguration > cafe.adriel.voyager:voyager-navigator:1.0.0-beta14 > cafe.adriel.voyager:voyager-navigator-android-debug:1.0.0-beta14
   > Could not find org.jetbrains.compose.ui:ui:1.0.1-rc2.
     Required by:
         project :modules:ui-bottomsheet-displayconfiguration > cafe.adriel.voyager:voyager-core:1.0.0-beta14 > cafe.adriel.voyager:voyager-core-android-debug:1.0.0-beta14
         project :modules:ui-bottomsheet-displayconfiguration > cafe.adriel.voyager:voyager-navigator:1.0.0-beta14 > cafe.adriel.voyager:voyager-navigator-android-debug:1.0.0-beta14

Is there a new way to handle the deps? I do not want jetbrain compose in the android app.

egorikftp commented 2 years ago

The same for me

DevSrSouza commented 2 years ago

Apparently Jetbrains Compose is not replacing the dependencies on gradle module metadata file, it is only on the pom file.

The only solution as a User that I can think is using excluding transitive dependencies like this: implementation("cafe.adriel.voyager:voyager-core-android-debug:1.0.0-beta14") { isTransitive = false } Can you try that to see if this solution work for you?

The solution as a project level it would by excluding compose dependencies from the publishing on Gradle Module Metadata.

Good references for this: https://blog.jetbrains.com/kotlin/2021/10/compose-multiplatform-goes-beta/#androidartifacts https://jakewharton.com/multiplatform-compose-and-gradle-module-metadata-abuse/

DevSrSouza commented 2 years ago

Testing here I found out that the Jetbrains Compose plugins is already replacing correctly but Gradle is only replacing it on the pom file for some reason, seems to be a Gradle issue.

https://github.com/gradle/gradle/issues/19452

adrielcafe commented 2 years ago

Fixed in 1.0.0-beta15. Thanks for your help @DevSrSouza !