2015-09-25 16 views
5

HttpClient hedef 23'te kullanımdan kaldırıldı, Bu yüzden hala projemde httpClient kullanmak istiyorum, bu yüzden projeyi yeniden oluşturduktan sonra grapert dosyasında aşağıdaki bağımlılık org.apache.http.legacy değerini ekledim Hata alıyorum.gradle dsl yöntem bulunamadı 'uselibrary()'

Error:(6, 0) Gradle DSL method not found: 'useLibrary()' Possible causes:

  • The project 'Development' may be using a version of Gradle that does not contain the method. Gradle settings
  • The build file may be missing a Gradle plugin. Apply Gradle plugin
  • Benim gradle dosyasıdır

    apply plugin: 'com.android.application' 
    
    android { 
        compileSdkVersion 23 
        buildToolsVersion "22.0.1" 
        useLibrary 'org.apache.http.legacy' 
    
        defaultConfig { 
         applicationId "com.android.mobile.test" 
         minSdkVersion 15 
         targetSdkVersion 24 
        } 
    
        buildTypes { 
         release { 
          minifyEnabled false 
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
         } 
        } 
    
        lintOptions{ 
         abortOnError false 
        } 
    } 
    
    dependencies { 
        compile project(':library') 
        compile 'com.google.android.gms:play-services:+' 
        compile files('FlurryAnalytics-5.5.0.jar') 
        compile files('HockeySDK-3.5.0.jar') 
        compile 'com.android.support:appcompat-v7:23.0.1' 
        compile 'com.android.support:design:23.0.+' 
    } 
    

    kök build.gradle

    // Top-level build file where you can add configuration options common to all sub-projects/modules. 
    buildscript { 
        repositories { 
         jcenter() 
        } 
        dependencies { 
         classpath 'com.android.tools.build:gradle:1.0.0' 
        } 
    } 
    
    allprojects { 
        repositories { 
         jcenter() 
        } 
    } 
    
    +0

    Ayrıca, proje kökünüzde bulacağınız üst düzey 'build.gradle' dosyasını da gönderin. – CommonsWare

    +0

    Eklendi lütfen şimdi bir göz atın –

    cevap

    19

    Değişimi:

    classpath 'com.android.tools.build:gradle:1.0.0' 
    

    için:

    classpath 'com.android.tools.build:gradle:1.3.0' 
    
    +5

    Ayrıca 1.3.1, son kararlı sürümü. –

    +0

    Ayrıca 1.5.0, mevcut sürüm – abriggs

    İlgili konular