2014-09-19 10 views
7

के साथ त्रुटि मैंने अपने एंड्रॉइड ग्रेडल प्लगइन को 0.12 से 0.13 तक अपडेट किया है। इसके अलावा मैंने ग्रेड 2.1 डाउनलोड किया है। फिर, मैंने बीटा में एंड्रॉइड स्टूडियो 0.8.9 के साथ प्रयास किया लेकिन http://tools.android.com/tech-docs/new-build-system/version-compatibility के अनुसार मुझे कम से कम एंड्रॉइड स्टूडियो 0.8.11 (कैनरी चैनल) का उपयोग करना होगा। इसलिए मैंने अपने एंड्रॉइड स्टूडियो को अपडेट किया है लेकिन मुझे अभी भी समस्या है।एंड्रॉइड ग्रैडल प्लगइन 0.13 और एंड्रॉइड-एपीटी 1.3

अभी के लिए, मैं Gradle 1.10 और एंड्रॉयड Gradle प्लगइन 0.12 उपयोग करने के लिए + से

के रूप में

Error:No such property: projectDependencies for class: com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated

संपादित

यहाँ त्रुटि काम करने के लिए:।

यहाँ है मेरा build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     // works with 0.12.+ (not with 0.13.+) 
     classpath 'com.android.tools.build:gradle:0.12.+' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 

     // The latest version of the android-apt plugin 
     classpath 'com.neenbedankt.gradle.plugins:android-apt:1.3' 
    } 
} 

allprojects { 
    repositories { 
     maven { // For Android-ViewPagerIndicator 
      url "http://dl.bintray.com/populov/maven" 
     } 
     jcenter() 
     mavenCentral() 
     maven { 
      url "http://JRAF.org/static/maven/2" 
     } 
    } 
} 

यहाँ मेरी gradle-wrapper.properties

#Fri Sep 19 17:50:42 CEST 2014 
distributionBase=GRADLE_USER_HOME 
distributionPath=wrapper/dists 
zipStoreBase=GRADLE_USER_HOME 
zipStorePath=wrapper/dists 
# use gradle-2.1-all.zip with android gradle plugin 0.13 
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip 

संपादित है 2:

apply plugin: 'com.android.application' 
apply plugin: 'android-apt' 

android { 
    compileSdkVersion 19 
    buildToolsVersion "20.0.0" 

    defaultConfig { 
     applicationId 'xxx' 
     minSdkVersion 10 
     targetSdkVersion 19 
     versionCode xxx 
     versionName 'xxx' 
    } 

    // For more information see 
    // @link http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Using-sourceCompatibility-1.7 
    compileOptions { 
     sourceCompatibility JavaVersion.VERSION_1_7 
     targetCompatibility JavaVersion.VERSION_1_7 
    } 

    signingConfigs { 
     debug { 
      storeFile file('../../KeyStore/debug.keystore') 
      storePassword 'android' 
      keyAlias 'androiddebugkey' 
      keyPassword 'android' 
     } 
     release { 
      storeFile file('xxx') 
      storePassword 'xxx' 
      keyAlias 'xxx' 
      keyPassword 'xxx' 
     } 
    } 

    buildTypes { 
     // Just intern. This is alpha build 
     debug { 
      buildConfigField "boolean", "FORCE_GOOG_GEO_API", "false" // can be set to true in debug but not in other buildTypes 
      buildConfigField "boolean", "ENABLE_LOG", "true" 
      buildConfigField "String", "HOST", "\"xxx\"" 
      versionNameSuffix '-alpha' 
      signingConfig signingConfigs.debug 
      zipAlign true 
     } 
     // For customer 
     recette { 
      buildConfigField "boolean", "FORCE_GOOG_GEO_API", "false" 
      buildConfigField "boolean", "ENABLE_LOG", "false" 
      buildConfigField "String", "HOST", "\"xxx\"" 
      versionNameSuffix '-recette' 
      signingConfig signingConfigs.debug 
      zipAlign true 
     } 
     // PreProd 
     preprod { 
      buildConfigField "boolean", "FORCE_GOOG_GEO_API", "false" 
      buildConfigField "boolean", "ENABLE_LOG", "false" 
      buildConfigField "String", "HOST", "\"xxx\"" 
      signingConfig signingConfigs.debug 
      zipAlign true 
     } 
     // Prod 
     release { 
      buildConfigField "boolean", "FORCE_GOOG_GEO_API", "false" 
      buildConfigField "boolean", "ENABLE_LOG", "false" 
      buildConfigField "String", "HOST", "\"xxx\"" 
      signingConfig signingConfigs.release 
      zipAlign true 
      runProguard true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt' 
     } 
    } 

    // This is important, it will run lint checks but won't abort build 
    lintOptions { 
     abortOnError false 
     disable 'MissingTranslation' 
    } 

    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'AndroidManifest.xml' 
    } 
} 

apt { 
    arguments { 
     resourcePackageName android.defaultConfig.packageName 
     androidManifestFile variant.processResources.manifestFile 
    } 
} 

def GoogPlayServVersion = '5.0.+'; 
def GsonVersion = '2.2.4'; 
def LibPhoneNumbVersion = '5.9'; 
def GreenRobotVersion = '2.2.1'; 
def OkHttpVersion = '2.0.0'; 
def OkHttpConnVersion = '2.0.0'; 
def JacksonCore = '2.4.1'; 
def JacksonDatabind = '2.4.1'; 
def JacksonAnnotations = '2.4.0'; 
def SwitchVersion = '1.3.1'; 
def CroutonVersion = '1.8.4'; 
def ActionBarSherlockVersion = '4.4.0'; 
def ViewpagerIndicatorVersion = '2.4.1'; 
def PicassoVersion = '2.3.4'; 
def RoboSpiceVersion = '1.4.12'; 
def StickyListHeaders = '2.4.1'; 
def AAVersion = '3.1'; 

def RobotiumVersion = '5.2.1'; 

dependencies { 
    // Include all jar in libs folder 
    compile fileTree(dir: 'libs', include: ['*.jar']) 

    // Google Play Services 
    compile "com.google.android.gms:play-services:$GoogPlayServVersion" 

    // Gson 
    compile "com.google.code.gson:gson:$GsonVersion" 

    // LibphoneNumber 
    compile "com.googlecode.libphonenumber:libphonenumber:$LibPhoneNumbVersion" 

    // GreenRobot 
    compile "de.greenrobot:eventbus:$GreenRobotVersion" 

    // OkHttp [We use repackaged version @see https://github.com/square/okhttp/issues/967] 
    // compile "com.squareup.okhttp:okhttp:$OkHttpVersion" 
    // compile "com.squareup.okhttp:okhttp-urlconnection:$OkHttpConnVersion" 

    // Jackson 
    compile "com.fasterxml.jackson.core:jackson-core:$JacksonCore" 
    compile "com.fasterxml.jackson.core:jackson-databind:$JacksonDatabind" 
    compile "com.fasterxml.jackson.core:jackson-annotations:$JacksonAnnotations" 

    // Switch backport 
    compile "org.jraf:android-switch-backport:$SwitchVersion" 

    // Crouton lib 
    compile("de.keyboardsurfer.android.widget:crouton:$CroutonVersion") { 
     // exclusion is not neccessary, but generally a good idea. 
     exclude group: 'com.google.android', module: 'support-v4' 
    } 

    // You must install or update the Support Repository through the SDK manager to use this dependency. 
    // The Support Repository (separate from the corresponding library) can be found in the Extras category. 
    // compile 'com.android.support:support-v4:19.1.0' 
    // compile 'com.android.support:gridlayout-v7:19.1.0' 

    // ActionBarSherlock 
    compile "com.actionbarsherlock:actionbarsherlock:[email protected]" 

    // Android-ViewPagerIndicator 
    compile "com.viewpagerindicator:library:[email protected]" 

    // Picasso 
    compile "com.squareup.picasso:picasso:$PicassoVersion" 

    // Robospice 
    compile "com.octo.android.robospice:robospice:$RoboSpiceVersion" 

    // StickyList headers 
    compile "se.emilsjolander:stickylistheaders:$StickyListHeaders" 

    // Facebook sdk 
    compile 'fr.avianey:facebook-android-api:[email protected]' 

    // android annotations 
    compile "org.androidannotations:androidannotations-api:$AAVersion" 
    apt "org.androidannotations:androidannotations:$AAVersion" 

    compile 'com.sothree.slidinguppanel:library:+' 

    // Tests part 
    androidTestCompile "com.jayway.android.robotium:robotium-solo:$RobotiumVersion" 
    compile "com.jayway.android.robotium:robotium-solo:$RobotiumVersion" 
} 

तुम्हें पता है मैं यह कैसे हल कर सकते हैं करते हैं?

Thx

+0

कृपया अपनी बिल्ड फाइलें और त्रुटि का पूरा स्टैक ट्रेस साझा करें। –

+0

यह एंड्रॉइड-स्टूडियो से पूर्ण स्टैकट्रेस है और ग्रेडल प्लगइन 0.13 के बीच एकमात्र परिवर्तन है। + और 0.12। + संस्करण संख्या है। यह 0.12 के साथ काम करता है। + और 0.13 के साथ नहीं। +। मुझे यकीन नहीं है कि समस्या धीरे-धीरे फ़ाइल में है, लेकिन मैं अपने वास्तविक निर्माण ग्रेड फ़ाइल के साथ अपना प्रश्न अपडेट करूंगा – mrroboaat

+0

क्या आपके 'ग्रेडल-रैपर' को 'वितरण यूआरएल = http \: //services.gradle.org/distributions/ नहीं कहना चाहिए Gradle-2.1-all.zip'? – nhaarman

उत्तर

15

android-उपयुक्त 1.3 एंड्रॉयड Gradle प्लगइन का v0.13 के साथ संगत होना करने के लिए प्रतीत नहीं होता। इसके बजाय एंड्रॉइड-एपीटी 1.4 का उपयोग करें:

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:0.13.0' 
     classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 
+0

देखें धन्यवाद! आप एक जीवन उद्धारक हैं! – Makerhack

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