无法使用Android Gradle Plugin 3.0。+使用IntelliJ IDEA [英] Can't use Android Gradle Plugin 3.0.+ with IntelliJ IDEA

查看:1635
本文介绍了无法使用Android Gradle Plugin 3.0。+使用IntelliJ IDEA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用Android Gradle Plugin 3.0。+与Intellij IDEA时,我收到错误:错误:此Gradle插件需要Studio 3.0最低

When I'm trying to use Android Gradle Plugin 3.0.+ with Intellij IDEA, I'm getting error: Error:This Gradle plugin requires Studio 3.0 minimum

但我的IntelliJ版本高于2017.2,它应该适用于AS 3.0的gradle插件。

But my version of IntelliJ is higher than 2017.2 and it should work with gradle plugin for AS 3.0.

推荐答案

可以通过将此选项添加到 gradle.properties 来修复:

It can be fixed by adding this option to your gradle.properties:

android.injected.build.model.only.versioned=3

说明:

来自Reddit / r / androiddev

From Reddit /r/androiddev


ModelBuilder 中进行版本检查,由执行同步操作时由IDE插入的Gradle
属性提供。
修复是将以下内容添加到gradle.properties:
android.injected.build.model.only.versioned = 3

A version check is in place in ModelBuilder that is fed by Gradle properties inserted by the IDE when you execute the Sync action. The fix is to add the following to gradle.properties: android.injected.build.model.only.versioned=3

AS 3.0发送
值3,而旧版本和IntelliJ发送1或更低,如果他们发送一个值,则
。一旦设置为指定,同步再次工作
,到目前为止一切正常运行。

AS 3.0 is sending the value 3, whereas older versions as well as IntelliJ send 1 or lower, if they send a value at all. Once set as specified, sync works again and everything so far has been operating normally.

Android Studio团队评论的完整答案

IntelliJ IDEA 2018.1+支持Android Gradle Plugin 3.0 +!

IntelliJ IDEA 2018.1+ supports Android Gradle Plugin 3.0+!

这篇关于无法使用Android Gradle Plugin 3.0。+使用IntelliJ IDEA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆