Android-Studio中gradle版本问题
作者:
爱森杰莫克 | 来源:发表于
2019-03-19 23:39 被阅读0次
[Android Studio导入项目,报错 Error:Unsupported method: BaseConfig.getApplicationIdSuffix().]
从GitHub上clone下来的第三方库,由于时间间隔很长,gradle的版本和本机的版本不一致,导入到#####Android Studio中会报错,错误信息如下:
Error:Unsupported method: BaseConfig.getApplicationIdSuffix().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
Consult IDE log for more details (Help | Show Log)
第一步:修改项目的build.gradle文件,找到dependencies,修改classpath
classpath 'com.android.tools.build:gradle:1.0.0'
改成:
classpath 'com.android.tools.build:gradle:2.3.2'
截图

644514-20180321161209915-1592056655.png
第二步:上一步修改了build.gradle中的版本之后,gradle-wrapper.properties文件中的gradle的版本#####也需要修改,由于上一步已经将build.gradle中的gradle版本已经升级到2.3.2,所以gradle-#####wrapper.properties中的gradle至少需要3.3版本以上。
直接修改:distributionUrl
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
截图

644514-20180321161934792-1704895001.png
本文标题:Android-Studio中gradle版本问题
本文链接:https://www.haomeiwen.com/subject/hctamqtx.html
网友评论