簡體   English   中英

依賴httpclient-AndroidStudio

[英]Dependency httpclient - AndroidStudio

我在Android Studio中的運行調試按鈕被禁用。 我已經看到了許多有關此問題的答案,但是對於我而言,解決方案並不正確。 這是我在gradle控制台中的錯誤:

WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
Incremental java compilation is an incubating feature.

這是我的build.gradle

 apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "myProjectPackageName"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
    maven {
        url "https://raw.github.com/embarkmobile/zxing-android-minimal/mvn-repo/maven-repository/"
    }
    maven { url "https://jitpack.io" }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:24.2.0'

    // Zxing libraries Scan
    compile 'com.embarkmobile:zxing-android-minimal:2.0.0@aar'
    compile 'com.embarkmobile:zxing-android-integration:2.0.0@aar'
    compile 'com.google.zxing:core:3.0.1'

    //Google api books
    compile 'com.google.apis:google-api-services-books:v1-rev80-1.21.0'
    compile 'com.google.android.gms:play-services-appindexing:9.4.0'

    // Dependency for Google Sign-In
    compile 'com.google.android.gms:play-services-plus:9.4.0'
    compile 'com.google.android.gms:play-services-auth:9.4.0'

    //Facebook Login
    compile 'com.facebook.android:facebook-android-sdk:4.13.2'

    // Dependency for Firebase
    compile 'com.google.firebase:firebase-messaging:9.4.0'
    compile 'com.google.firebase:firebase-database:9.4.0'
    compile 'com.google.firebase:firebase-storage:9.4.0'
    compile 'com.github.bumptech.glide:glide:3.7.0'


}



dependencies {
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
}
apply plugin: 'com.google.gms.google-services'

非常感謝您的幫助

您需要在build.gradle文件中排除dependencies build.gradle

compile('com.google.apis:google-api-services-books:v1-rev80-1.21.0') {
    exclude module: 'httpclient' 
    exclude group: 'org.apache.httpcomponents' 
    exclude group: 'org.apache.httpcomponents', module: 'httpclient' 
}

嘗試從所有配置中排除它。

configurations {
    compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
}

重新啟動Studio,然后再次檢查。 或從“運行”按鈕旁邊的下拉菜單中選擇應用程序模塊。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM