compileKotlin block in build.gradle file throws error “Could not find method compileKotlin() for arguments […]”

后端 未结 3 1430
甜味超标
甜味超标 2020-12-08 02:07

I\'m trying to configure Kotlin to work with Java 1.8 in my Android project. I\'ve tried adding the compileKotlin block at the bottom of my build.gradle

3条回答
  •  心在旅途
    2020-12-08 02:26

    Not a direct answer to the question, but Google led me to this answer when experiencing the same compileKotlin block in build.gradle file throws error “Could not find method compileKotlin() for arguments […]” error.

    In my case the problem was caused by importing a code module to my project that contained only Java code. The fix was to ensure the following is in the Java-specific module's build.gradle:

    apply plugin: 'kotlin-android'
    

提交回复
热议问题