5

I changed everything else as needed in my gradle files, but I'm hitting one error I can't seem to resolve:

Error:Unable to find method 'org.gradle.api.internal.project.ProjectInternal.getConfigurations()Lorg/gradle/api/internal/artifacts/configurations/ConfigurationContainerInternal;'.

Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

Stop Gradle build processes (requires restart)
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

If it's of any help, here's my main build.gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 21
        versionCode 9
        versionName "1.6"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile files('libs/gson-2.2.4.jar')
    compile project('libs:anddown')
    compile 'com.android.support:appcompat-v7:21.0.2'
    compile files('libs/android-support-v7-recyclerview.jar')
}
1
  • What version of the Gradle for Android plugin are you using? If this is a traditional Android Studio project, that would be in the top-level build.gradle file. Also, why are you not using dependencies for Gson and RecyclerView? Or my CWAC-AndDown, assuming that's what libs:anddown refers to? Commented Dec 10, 2014 at 20:29

5 Answers 5

20

I was able to resolve this error by upgrading to the lastest release of my android maven plugin:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        ...
        classpath 'com.github.dcendents:android-maven-plugin:1.2'
    }
}
Sign up to request clarification or add additional context in comments.

2 Comments

Actually this should be checked as the right answer, because it doesn't remove the maven plugin from the project.
Where do I find that?
12

Cleaning project or gradle did not work for me. I had to change gradle distribution from 2.2.1 to 2.4.

In gradle-wrapper.properties file:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip

Comments

7

I also had this issue. This was resolved once I removed apply plugin: 'android-maven' from one of my build files.

1 Comment

That's not the right answer as you remove the possibilities that this plugin gives. Instead upgrade the version to 1.2 as Kio suggests.
0

The newest android studio requires gradle version 2.2+ , are you using this version ? If yes, try invalidate cache / restart on File menu.

Comments

0

If those previous answers don't work and you are upgrading your Android Studio, try to update the gradle/wrapper folder by creating a new project and copying this folder from the new project and overwriting to your old one. It worked for me.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.