skip to Main Content

I am getting the following error when trying to use Android Studio Layout inspector to debug my composables

Could not download androidx.compose.ui:ui:writeVersionFile .... (See a picture)

enter image description here

How can I fix this?

Addition Info

  • Mac M1 Chip
  • Android Studio Flamingo | 2022.2.1 Beta 2
  • Internet: OK

2

Answers


    • Add the mavenCentral() repository in your project’s build.gradle

    file:

    allprojects {
            repositories {
                google()
                mavenCentral()
                jcenter()
            }
        }
    

    Reload your project and update Gradle dependencies.

    dependencies {
        implementation("androidx.compose.ui:ui:1.3.3")
    }
    
    android {
        buildFeatures {
            compose = true
        }
    
        composeOptions {
            kotlinCompilerExtensionVersion = "1.4.2"
        }
    
        kotlinOptions {
            jvmTarget = "1.8"
        }
    }
    

    You can find more information at this link

    [https://developer.android.com/jetpack/androidx/releases/compose-ui]

    Login or Signup to reply.
  1. I faced the same issue here. The kotlinCompilerExtensionVersion 1.4.2 isn’t released. The latest version is 1.4.1-dev-k1.8.10-c312d77f4cb.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search