1

Andoid Studio 3.4

app/build.gradle:

android {
    compileSdkVersion 28
    defaultConfig {
        minSdkVersion 18
        targetSdkVersion 28
        versionCode 427
        versionName "2.1.427"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"


implementation 'com.crashlytics.sdk.android:crashlytics:2.9.7'
    implementation 'com.google.android.gms:play-services-gcm:16.0.0'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.j256.ormlite:ormlite-android:5.1'
    implementation 'commons-codec:commons-codec:1.11'
    implementation 'commons-io:commons-io:2.6'
    implementation 'org.apache.commons:commons-lang3:3.8.1'
    implementation 'org.apache.httpcomponents:httpclient:4.5.8'
    implementation "org.androidannotations:androidannotations-api:$AAVersion"
    implementation "org.androidannotations:ormlite-api:$AAVersion"

But I get error in this line:

implementation 'org.apache.httpcomponents:httpclient:4.5.8'


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 jarjar. more... (Ctrl+F1)
Alexei
  • 14,350
  • 37
  • 121
  • 240
  • you can use http by adding this in application tag in maifest "" when you targeting android 28 – pratik vekariya May 15 '19 at 13:51
  • 1
    Not help. Same error – Alexei May 15 '19 at 14:38
  • can you remove apache dependency from gradle and try again with above suggetion? And also try, use these two apache dependency to use "http" implementation 'org.apache.httpcomponents:httpcore:4.4.1' implementation 'org.apache.httpcomponents:httpclient:4.5'. These two dependency also solved my problem. – pratik vekariya May 16 '19 at 06:07
  • @pratikvekariya I can't remove apache dependency because as result my project not compile. – Alexei May 16 '19 at 07:08

0 Answers0