27

I have Android Studio 0.8.9. Until now, It could sync with gradle files successfully, But today when I opened it, It gives me this error:

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.

Can you help me solve this? Thanks.

user3184899
  • 3,019
  • 6
  • 30
  • 38

2 Answers2

29

As stated by Justin, Upgrading to Android Studio 0.9.0 fixes this issue.

Community
  • 1
  • 1
Jeff Brateman
  • 3,229
  • 2
  • 20
  • 26
15

To correct this issue I down-graded the android-plugin in your projects top level build.gradle file from classpath 'com.android.tools.build:gradle:0.14.+' to classpath 'com.android.tools.build:gradle:0.13.+'

So right now the buildscript method in my projects build.grade looks like

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.+'
  }
}

I think there may be a bug with version .14, I sent my error report.

FeelGood
  • 5,594
  • 2
  • 25
  • 22
Danuofr
  • 1,661
  • 19
  • 25
  • Also make sure you have latest build tools, platform tools, android repository, google repository installted. And GMS services if using that all from SDK manager. – Danuofr Nov 01 '14 at 19:48
  • Can you link to the issue you opened? – Jeremy D Nov 03 '14 at 04:49
  • Where is the bug report? – Phil Nov 03 '14 at 16:10
  • 11
    Encountered the same problem this morning. Upgrading to Android Studio 9.0 appears to have fixed the problem. – Justin Pollard Nov 03 '14 at 18:49
  • 1
    Yeah upgrading Android Studio, on the Canary channel actually fixes it to work with .14...Keep in mind you have to move your android SDK library outside of the Android Studio installation directory for the Canary channel update to install. – Danuofr Nov 05 '14 at 18:51
  • I'm not going to link the bug report because it's an upgrade issue ;). – Danuofr Nov 05 '14 at 18:53