Java 错误:没有这样的属性:类的 GradleVersion:JetGradlePlugin
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/53600179/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error:No such property: GradleVersion for class: JetGradlePlugin
提问by Khuzi
I am getting below error in intellij for a gradle project. I am importing existing gradle project and trying refresh it in gradle window.
我在一个 gradle 项目的 intellij 中遇到错误。我正在导入现有的 gradle 项目并尝试在 gradle 窗口中刷新它。
Error:No such property: GradleVersion for class: JetGradlePlugin
Please advise.
请指教。
采纳答案by ylemp
I had this problem while upgrading to java 11.
我在升级到 java 11 时遇到了这个问题。
I had to downgrade gradle from 5.0 to 4.10.3. Then I needed to upgrade to the latest version of Intellij Idea. You'll probably just need to upgrade Intellij.
我不得不将 gradle 从 5.0 降级到 4.10.3。然后我需要升级到最新版本的 Intellij Idea。您可能只需要升级 Intellij。
edit: Downgrading gradle is the fix. The Intellij version didn't matter.
编辑:降级 gradle 是解决方法。Intellij 版本无关紧要。
回答by qiuxiaoyan
it's work downgrade gradle from 5.1.1 to 4.10.3
它将工作从 5.1.1 降级到 4.10.3
回答by Nikita Skvortsov
You need at least Idea 2017.3 to work with Gradle 5.0+, earlier versions are not compatible because of implicit import being removed in version 5.0. See related youtrack ticket
您至少需要 Idea 2017.3 才能使用 Gradle 5.0+,早期版本不兼容,因为在 5.0 版本中删除了隐式导入。查看相关的youtrack票
回答by zollak
I just had to downgrade gradle from 5.1.1 to 4.10.3 to resolve it. However it caused an another error: “cannot resolve symbol R” in Android Studio. I was using gradle 3.3.0. It was the main culprit. Gradle 3.2.1 removed the error.
我只需要将 gradle 从 5.1.1 降级到 4.10.3 来解决它。然而,它导致了另一个错误:在 Android Studio 中“无法解析符号 R”。我正在使用 gradle 3.3.0。这是罪魁祸首。Gradle 3.2.1 删除了错误。
回答by ktk
This worked for me. Go to 'Settings -> Build, Execution, Deployment -> Build Tools -> Gradle' And select 'Use local gradle distribution'
这对我有用。转到“设置 -> 构建、执行、部署 -> 构建工具 -> Gradle”并选择“使用本地 gradle 分发”
回答by Praneeth Jayarathna
After a couple of days, I found a solution to this.
几天后,我找到了解决方案。
1)First, find the Gradle version (gradle -v), In my case, Gradle version was 4.1.
1)首先,找到Gradle版本(gradle -v),在我的例子中,Gradle版本是4.1。
2)Then in the android studio change my Gradle version to 4.1 (File --> Project Structure -> Project)
2)然后在android studio中将我的Gradle版本更改为4.1(文件->项目结构->项目)
3)Click ok Button.
3)点击确定按钮。
that's it :)
就是这样 :)
回答by Ishan De silva
This was happend to me after i fromat my lap and after installing android 3.1 i tryed to open my projects then this error came
这发生在我从膝盖上并安装 android 3.1 后,我尝试打开我的项目,然后出现此错误
This worked for me:
这对我有用:
unstall the android studio > reinstaleled it and updat to the leatest version > upadate gradle
卸载 android studio > 重新安装它并更新到最新版本 > 更新 gradle