this issue due to mismatched kotlin-gradle-plugin
and com.android.tools.build:gradle
, in my case i was use
com.android.tools.build:gradle:3.5.4
and bump up version to org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31
to address the issue just use matched version of AGP and KGP
To address the use matched versions like so.
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
but if you using AGP 7.0.3, make sure you have these version for KGP and Hilt Gradle Plugin like so.
classpath "com.android.tools.build:gradle:7.0.3"
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31'
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.39.1'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.