Jetpack Compose dependencies in existing Multi-Module app

Viewed 1228

I'm facing issues while integrating jetpack compose in a multi-module project.

One module library has all the dependencies for jetpack compose, and I am able to compile and Run the jetpack compose code written inside that module.

 android {
    ...
   kotlinOptions {
      jvmTarget = '1.8'
      useIR = true
   }

   buildFeatures {
      compose true
   }

   composeOptions {
      kotlinCompilerExtensionVersion compose_version
      kotlinCompilerVersion '1.4.21'
   }
 }


dependencies {
   ...
   implementation "androidx.compose.ui:ui:$compose_version"
   implementation "androidx.compose.material:material:$compose_version"
   implementation "androidx.compose.ui:ui-tooling:$compose_version"
   ...
}

Where compose_version = '1.0.0-alpha09'

Issue comes when I add that library module into app module and integrate the jetpack compose there. It requires to add all the dependencies inside app module's build.gradle.kts file also.

After adding same code of lines, gradle task (:app:compileDebugKotlin) keeps running in infinite loop without any error message.

What i am doing wrong here? any help would be appreciable. Thanks!

Update-1 Running gradlew compileDebugKotlin --debug, It stuck with below stack-trace

2020-12-30T12:26:42.079+0530 [DEBUG] 
[org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on 
daemon addresses registry.
2020-12-30T12:26:42.079+0530 [DEBUG] 
[org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire 
shared lock on daemon addresses registry.
2020-12-30T12:26:42.080+0530 [DEBUG] 
[org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on 
daemon addresses registry.
2020-12-30T12:26:42.080+0530 [DEBUG] 
[org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on 
daemon addresses registry.
1 Answers
Related