今天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() } 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.+‘
就OK了
时间: 2024-10-22 14:36:59