????????使用Android Studio Tools中的工具將Java項(xiàng)目轉(zhuǎn)為Kotlin項(xiàng)目時(shí)報(bào)了如下錯(cuò)誤:
Unable to find method 'org.gradle.api.internal.file.DefaultSourceDirectorySet.<init>(Ljava/lang/String;Lorg/gradle/api/internal/file/FileResolver;)V'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
????????經(jīng)過(guò)一番搜索資料發(fā)現(xiàn)狈孔,在工具為我們生成配置項(xiàng)時(shí)在在根據(jù)下的build.gradle中默認(rèn)為我們添加的版本時(shí)1.0.0。 我們只需將其改為Adroid Studio中Plugins kotin插件的版本就可以了,如我的項(xiàng)目改為“1.4.0”就可以正常打包了带污。