我有Android Studio 0.8.9。 到目前为止,它可以成功地与gradle文件同步, 但是今天当我打开它时,它给了我这个错误:
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.
你可以帮我解决这个问题吗?感谢。
答案 0 :(得分:30)
正如Justin所述,升级到Android Studio 0.9.0修复了此问题。
答案 1 :(得分:15)
为了解决这个问题,我在你的项目顶级build.gradle文件中对android-plugin进行了降级 classpath'com.android.tools.build:grad:0.14.+' 至 classpath'com.android.tools.build:gradle:0.13。+'
所以现在我的项目build.grade中的buildscript方法看起来像
buildscript {
repositories {
mavenCentral()
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:0.13.+'
}
}
我认为版本.14可能存在错误,我发送了错误报告。