Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find method androidExtensions()

I want to use the features of kotlin @Parcelize, I have apply the plugin: 'kotlin-android-extensions' on gradle, and I added

androidExtensions { 
    experimental = true 
}

but errors continue to appear.this error message :

Error:(28, 0) Could not find method androidExtensions() for arguments [build_8di01fmxa4d18k9q0yy3fdd20$_run_closure2@27f46852] on project ':app' of type org.gradle.api.Project.
<a href="openFile:F:\BELAJAR\ANDROID\AndroidStudioProjects\KADE\app\build.gradle">Open File</a>
like image 405
salim Avatar asked Dec 24 '22 03:12

salim


1 Answers

  • Use the latest version of Kotlin (>= v1.1.51)
  • Use the latest version of Kotlin Android Extensions in your app module, so your build.gradle may look like:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
   androidExtensions {
     experimental = true
   } 
}

dependencies {
  // ...
}
like image 74
SML Avatar answered Jan 09 '23 06:01

SML