[android]依赖项 httpclient studio

发布时间: 2016/9/26 4:58:50
注意事项: 本文中文内容可能为机器翻译,如要查看英文原文请点击上面连接.

我的运行 debug 中的按钮我 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'

非常感谢你的帮助

解决方法 1:

你需要排除 dependenciesbuild.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,然后重新检查。要么选择应用模块从滴下来或者 menu 旁边运行 button

官方微信
官方QQ群
31647020