https://kotlinlang.org logo
Title
s

Slackbot

07/10/2022, 7:55 PM
This message was deleted.
d

Daniel Rotenberg

07/10/2022, 7:56 PM
I checked the external libraries imports and it seems like compose properly imported as you can see in the screen shot attached.
I tried to compile with Kotlin version 1.6.21 and compose version 1.2.0-rc02, also tried with kotlin version 1.7.0 and compose compiler version 1.1.1. , last try was with Kotlin version 1.6.10 and compose version 1.1.0. attached code below:
Android.app module - compileOptions { sourceCompatibility JavaVersion._VERSION_1_8_ targetCompatibility JavaVersion._VERSION_1_8_ } kotlinOptions { jvmTarget = '1.8' } buildFeatures { compose true } composeOptions { kotlinCompilerExtensionVersion compose_version } packagingOptions { pickFirst 'META-INF/AL2.0' pickFirst 'META-INF/LGPL2.1' } //compose implementation "androidx.compose.runtime:runtime:$compose_version" implementation "androidx.compose.ui:ui:$compose_version" implementation "androidx.compose.foundation:foundation-layout:$compose_version" implementation "androidx.compose.material:material:$compose_version" implementation "androidx.compose.material:material-icons-extended:$compose_version" implementation "androidx.compose.material3:material3-window-size-class:1.0.0-alpha13" implementation "androidx.compose.foundation:foundation:$compose_version" implementation "androidx.compose.animation:animation:$compose_version" implementation "androidx.compose.ui:ui-tooling-preview:$compose_version" implementation "androidx.compose.runtime:runtime-livedata:$compose_version" debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
Project module - // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = '1.6.21' ext.compose_version = '1.2.0-rc02' repositories { google() } dependencies { def nav_version = "2.4.1" classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" /*classpath 'com.android.tools.build:gradle:7.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"*/ } } plugins { id 'com.android.application' version '7.1.0' apply false id 'com.android.library' version '7.1.0' apply false id 'org.jetbrains.kotlin.android' version '1.6.21' apply false id 'org.jetbrains.kotlin.jvm' version '1.6.21' apply false id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false }
At some point I somehow managed to detect Compose but only run time and ui package. Foundation and material compose couldn’t detect at all. no errors or warning thrown, it’s simply not working. any idea to solve it will be much appreciated
s

Stylianos Gakis

07/10/2022, 8:00 PM
Use this compatibility map to avoid guessing which Kotlin version fits with which compose compiler version https://developer.android.com/jetpack/androidx/releases/compose-kotlin
d

Daniel Rotenberg

07/10/2022, 8:03 PM
@Stylianos Gakis Yes, I followed the instructions there. I tried few different combos from suggest options just to make sure it isn't version specific issue