关于android studio Gradle报错

来源:互联网 发布:好易网络电视直播 编辑:程序博客网 时间:2024/05/16 05:59

今天android studio跑项目,build了一下,始终跑不起,把gradle和android studio都更新了一下,还是不行,

一直报这个错误

UnsupportedMethodException         Failed to set up Android modules in project 'Project': Unsupported method: SourceProvider.getJniDirectories().         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.



这时候搜了下,才知道是build.gradle里面的问题:

buildscript {    repositories {        jcenter()    }<pre name="code" class="java">classpath 'com.android.tools.build:gradle:0.13.+'

dependencies { classpath 'com.android.tools.build:gradle:0.14.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}



其中的这句是个bug


classpath 'com.android.tools.build:gradle:0.14.0'


改成

classpath 'com.android.tools.build:gradle:0.13.+'



1 1