Plugin id contains invalid char ':' (only ASCII alphanumeric characters, '.', '_' and '-' characters are valid JETPACK COMPOSE

Viewed 2243

I want to install jetpack compose in my android project. I was following this guide: https://developer.android.com/jetpack/compose/interop/adding

But when I tried to sync project, I got the error in my gradle file:

    A problem occurred evaluating project ':app'.
    > plugin id 'org.jetbrains.kotlin:android' is invalid: Plugin id contains invalid char ':' (only ASCII alphanumeric characters, '.', '_' and '-' characters are valid

)

here is the error occurs

plugins {
        id 'com.android.application'
        id 'kotlin-android'
        id 'org.jetbrains.kotlin:android' version '1.5.21'
    
    }

What am i doing wrong?

1 Answers

This is a mistake in the documentation. I'm raising this internally and submitting a change to get it fixed.

In the meantime, you should instead simply ensure that you have the Kotlin Android plugin in your project:

plugins {
    id 'kotlin-android'
}

and then set the proper compiler version in the composeOptions block:

    composeOptions {
        kotlinCompilerExtensionVersion '1.0.1'
        kotlinCompilerVersion '1.5.21'
    }
Related