Нужна помощь, я новичок в Android Studio - PullRequest
0 голосов
/ 05 мая 2020

Я получил задание продолжить проект Android Studio, но когда я выпущу APK, возникает такая ошибка.

../../build.gradle: commons-logging defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example, for httpclient use HttpUrlConnection or okhttp instead), or repackaging the library using something like jarjar.

../../build.gradle: httpclient defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example, for httpclient use HttpUrlConnection or okhttp instead), or repackaging the library using something like jar.

Это в моих зависимостях в build.gradle

 dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.google.code.gson:gson:2.4'
    compile 'org.apache.httpcomponents:httpcore:4.2.4'
    compile 'org.apache.httpcomponents:httpmime:4.3'
    compile 'com.android.support:appcompat-v7:28.0.0'
    compile 'com.android.support:support-compat:28.0.0'
    compile 'com.android.support:design:28.0.0'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
    compile 'com.android.support:support-v4:28.0.0'
    compile 'com.google.code.gson:gson:2.4'
    compile 'com.google.zxing:core:3.2.1'
    compile 'com.google.android.gms:play-services-maps:11.0.4'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:cardview-v7:28.0.0'
    compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
    compile 'me.dm7.barcodescanner:zxing:1.9'
    compile 'com.google.firebase:firebase-messaging:11.0.4'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

но не знаю, в чем проблема ..

1 Ответ

0 голосов
/ 05 мая 2020

Добавьте это в build.gradle найдите в модуле приложения

configurations {
    all {
        exclude module: 'httpclient'
    }
}

Надеюсь, это сработает

Спасибо! Удачного кодирования!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...