今天android studio跑项目,build了一下,始终跑不起,把gradle和android studio都更新了一下,还是不行,
一直报这个错误
[java] view plain copy
- 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里面的问题:
[java] view plain copy
- 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
[java] view plain copy
- classpath 'com.android.tools.build:gradle:0.14.0'
改成
[java] view plain copy
- classpath 'com.android.tools.build:gradle:0.13.+'