2015-09-09 6 views
7

मैं अपने एंड्रॉइड प्रोजेक्ट को नए प्रयोगात्मक ग्रेडल प्लगइन में माइग्रेट करने का प्रयास करता हूं। मैंने this पृष्ठ पर निर्देशों का पालन किया। मैंने आवश्यक फाइलों में बदलाव किए हैं, लेकिन जब मैं प्रोजेक्ट को स्प्रिंग फ़ाइलों के साथ सिंक करने की कोशिश करता हूं तो मुझे एक त्रुटि होती है।नए प्रायोगिक ग्रेडल प्लगइन को प्रोजेक्ट माइग्रेट करना

apply plugin: 'com.android.model.application' 
apply plugin: 'maven' 

repositories { 
    maven { 
     url = getBaseRepository() 
     credentials { 
      username = NEXUS_USERNAME 
      password = NEXUS_PASSWORD 
     } 
    } 
    mavenCentral() 
} 

def int CACHE_LIMIT = CACHE_CHANGING_MODULES_FOR_SECONDS.toInteger() 

configurations.all { 
    resolutionStrategy.cacheChangingModulesFor CACHE_LIMIT, 'seconds' 
} 

model { 
    android { 
     compileSdkVersion = 23 
     buildToolsVersion = "23.0.0" 

     defaultConfig.with { 
      applicationId = "<myRealAppIdIsHere>" 
      minSdkVersion.apiLevel = 14 
      targetSdkVersion.apiLevel = 18 

      multiDexEnabled = true 
     } 
    } 

    android.buildTypes { 
     debug { 
      /*buildConfigField.with { 
       create() { 
        type = "boolean" 
        name = "DEBUG_BUILD" 
        value = rootProject.ext.debugBuild 
       } 
      }*/ 
     } 
     release { 
      minifyEnabled = false 
      proguardFiles += 'proguard-rules.pro' 
      /*buildConfigField.with { 
       create() { 
        type = "boolean" 
        name = "DEBUG_BUILD" 
        value = rootProject.ext.releaseBuild 
       } 
      }*/ 
     } 
    } 
} 


dependencies { 
    // my dependencies are here... 
} 

किसी को पता है, जहां समस्या है:

Error:Unable to load class 'com.android.build.gradle.managed.ProductFlavor_Impl'. Possible causes for this unexpected error include:

  • 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)
  • Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

build.gradle मेरी app फ़ोल्डर में बहुत ही इस के समान है? मैं, पता नहीं क्यों त्रुटि संदेश ProductFlavor के बारे में समस्या में शामिल है क्योंकि अपने प्रोजेक्ट कोई जायके है ...

अद्यतन

मैं अपने प्रोजेक्ट को साफ करने की कोशिश की - स्वच्छ सफल नहीं था, लेकिन स्वच्छ दौरान त्रुटि संदेश अधिक विशिष्ट है:

Error:(10, 1) A problem occurred configuring project ':app'. Exception thrown while executing model rule: com.android.build.gradle.model.BaseComponentModelPlugin$Rules#createVariantData(org.gradle.model.ModelMap, org.gradle.model.ModelMap, com.android.build.gradle.internal.TaskManager) > afterEach() Could not resolve all dependencies for configuration ':app:_debugCompile'. Exception thrown while executing model rule: model.android Cannot set readonly property: minSdkVersion for class: com.android.build.gradle.managed.ProductFlavor_Impl

लेकिन फिर भी मुझे नहीं पता कि मैं इसे कैसे ठीक कर सकता हूं।

minSdkVersion.apiLevel 
targetSdkVersion.apiLevel 

के बजाय:

minSdkVersion 
targetSdkVersion 

मैं एक ही मुद्दा था और यह यह तय

+0

यह बहु-मॉड्यूल प्रोजेक्ट में हो सकता है। क्या आपके पास अपनी परियोजना में एक से अधिक मॉड्यूल हैं? –

+0

हमारे पास एक ही समस्या है। हमारी परियोजना में एक मॉड्यूल शामिल है। हम इस समस्या को कैसे हल कर सकते हैं? –

उत्तर

6

मामले में यह सुनिश्चित करें कि आपके अपने प्रोजेक्ट में वास्तविक फ़ाइल नहीं है,।

+1

यह ** createVariantData ** त्रुटि से कैसे जुड़ा हुआ है? –

संबंधित मुद्दे