New Gradle Sync is not supported due to containing Kotlin modules using an unsupported plugin versio

androidstudio导入别人的代码后编译报错:New Gradle Sync is not supported due to containing Kotlin modules using an unsupported plugin version

看错误提示应该是kotlin版本不兼容问题导致无法完成Gradle构建。

于是搜索到这个文章:

https://fluttercorner.com/new-gradle-sync-is-not-supported-due-to-containing-kotlin-modules-using-an-unsup/

而实际上,最后不仅修改了Language下的Kotlin语言的版本,也重新提高了新的Gradle构建版本,问题便得到解决。

如果还解决不了,可以看看是不是AndroidStudio版本太老导致的,可以升级到最新的稳定版,这里是升级AndroidStudio版本到了4.1.3

以下是上面链接文章的具体内容:

What Is Error ?

When trying to add cloud_firestore to my app, I have the following issue in my stack track.

Error message

    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: com.android.tools.idea.gradle.project.sync.ng.NewGradleSyncNotSupportedException: New Gradle Sync is not supported due to containing Kotlin modules using an unsupported plugin version
    at com.android.tools.idea.gradle.project.sync.ng.SyncProjectModels.failIfKotlinPluginApplied(SyncProjectModels.java:108)
    at com.android.tools.idea.gradle.project.sync.ng.SyncProjectModels.failIfKotlinPluginApplied(SyncProjectModels.java:111)
    at com.android.tools.idea.gradle.project.sync.ng.SyncProjectModels.populate(SyncProjectModels.java:84)
    at com.android.tools.idea.gradle.project.sync.ng.SyncAction.execute(SyncAction.java:59)
Cause 2: org.gradle.internal.exceptions.LocationAwareException: New Gradle Sync is not supported due to containing Kotlin modules using an unsupported plugin version

Solutions

New Gradle Sync is not supported due to containing Kotlin modules using an unsupported plugin version

Question : How to solve New Gradle Sync not supported due to containing Kotlin modules using unsupported plugin version ?
Answer : This issue cause of JVM version. Solution of this error to update JVM version in kotlin compiler Setting with this instruction.

Solution 1

This issue cause of JVM version. Solution of this error to update JVM version in kotlin compiler Setting with this instruction.

  1. So, I  had to update my JVM Version in Kotlin Compiler settings.
  2. You can find that setting here: File -> Settings -> Kotlin Compiler -> Target JVM Version
  3. Changing to 1.8 fixed the issue.

Solution 2

It could be that your IDE has an older level of the Kotlin plugin.

Within Android Studio, got to File > Settings... > Kotlin and check to make sure your plugin is up to date. You may see something like this, indicating you need to update:

Solution 3

First Check your JVM version

  1. Open Window
  2. Go to Java from Programs
  3. Open ‘About Java’ and this will show you the version of your JVM

Now Update JVM version in your Android Studio

  1. File -> Settings.. -> Kotlin Compiler
  2. Go to ‘Target JVM Version’
  3. Select the version that your JVM have.

That’s it. Your studio will build again automatically..

Solution 4

For Mac(Catalina) Users

  1. Select Android Studio (This is hidden, move your cursor to the top of the screen to reveal this option)
  2. Then,
  3. Preferences -> Kotlin Compiler -> Target JVM Version
  4. now modify the respective java version, I changed Target JVM version from 1.6 to 1.8 to make it work.
  5. Shortcut to open Preferences in Android Studio is Cmd + ,

Hope This Above 4 Solution Will Work For You Too. So it’s all About this error. Hope this article helped you a lot. Comment below Your thoughts and your queries. And Also Comment on your suggestion here.

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值