2014-12-10 13 views
5

मैं सब कुछ के रूप में मेरे Gradle फाइलों में जरूरत बदल के साथ 1.0 Gradle त्रुटि, लेकिन मैं एक त्रुटि मार कर रहा हूँ मैं हल नहीं कर पा रहे:एंड्रॉयड स्टूडियो getConfiguration()

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. 

यह किसी भी मदद की है तो , यहां मेरा मुख्य build.gradle फ़ाइल है:

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') 
} 
+0

एंड्रॉयड प्लगइन के लिए क्या Gradle के संस्करण का उपयोग कर रहे हैं? यदि यह एक पारंपरिक एंड्रॉइड स्टूडियो प्रोजेक्ट है, जो शीर्ष-स्तर 'build.gradle' फ़ाइल में होगा। इसके अलावा, आप जीसन और रीसाइक्लर व्यू के लिए निर्भरताओं का उपयोग क्यों नहीं कर रहे हैं? या मेरा सीडब्ल्यूएसी-एंडडाउन, यह मानते हुए कि 'libs: anddown' क्या है? – CommonsWare

उत्तर

7

मुझे यह समस्या भी थी। मेरी बिल्ड फाइलों में से एक से apply plugin: 'android-maven' हटा दिए जाने के बाद यह हल हो गया था। और

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

धन्यवाद! यह त्रुटि से छुटकारा पा लिया। –

+3

यह सही जवाब नहीं है क्योंकि आप इस प्लगइन की संभावनाओं को हटाते हैं। इसके बजाय संस्करण को 1.2 में अपग्रेड करें क्योंकि केयो सुझाव देता है। – galex

0

नवीनतम एंड्रॉइड स्टूडियो को ग्रेड संस्करण 2.2+ की आवश्यकता है, क्या आप इस संस्करण का उपयोग कर रहे हैं? यदि हां, फ़ाइल मेनू पर कैश/पुनरारंभ करें अमान्य कोशिश करें।

20

मैं अपने एंड्रॉयड Maven प्लगइन के नवीनतम रिलीज पर अपग्रेड करके इस त्रुटि को हल करने में सक्षम था एक नई परियोजना बनाकर और इस फ़ोल्डर को नई परियोजना से कॉपी करके और अपने पुराने को ओवरराइट करके प्रतिलिपि/रैपर फ़ोल्डर। यह मेरे लिए काम किया।

+1

असल में इसे सही उत्तर के रूप में चेक किया जाना चाहिए, क्योंकि यह प्रोजेक्ट से मेवेन प्लगइन को नहीं हटाता है। – fragon

+0

मुझे यह कहां मिल सकता है? –

0

उन पिछले जवाब काम नहीं करते हैं तो आप अपने Android स्टूडियो, अद्यतन करने के लिए कोशिश उन्नयन कर रहे हैं:

11

सफाई परियोजना या ग्रेडल मेरे लिए काम नहीं किया। मुझे धीरे-धीरे वितरण 2.2.1 से 2.4 में बदलना पड़ा।

gradle-wrapper.properties फ़ाइल में:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 
संबंधित मुद्दे