Android Studio 1.0 Gradle Error with getConfiguration ()

I changed everything else as needed in my gradle files, but I ended up with one error that I cannot solve:

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 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 this helps, here is 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') } 
+5
source share
5 answers

I also had this problem. This was resolved after removing apply plugin: 'android-maven' from one of my build files.

+7
source

I was able to resolve this error by updating to the latest version of my android maven plugin:

 buildscript { repositories { mavenCentral() } dependencies { ... classpath 'com.github.dcendents:android-maven-plugin:1.2' } } 
+20
source

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

In the gradle-wrapper.properties file:

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

The newest Android studio requires gradle version 2.2+, are you using this version? If so, try invalidating the cache / restart in the File menu.

0
source

If these previous answers do not work, and you are updating your Android studio, try updating the gradle / wrapper folder by creating a new project and copying this folder from the new project and rewriting it to the old one. It worked for me.

0
source

Source: https://habr.com/ru/post/1208761/


All Articles