Android Studio build errors with jack enabled - java

So i recently switched my Android Studio default JDK to Java 8, so I could use Lambda expressions. I had to enable Jack to let the gradle build, but now when I try to rebuild my applicaiton, I am getting about 3 different errors that seem to be coming from Jack. I can't seem to find the root of any of these problems, and would like to stay building with J8. Any insight or help for this is much appreciated. Here are the errors I am getting during build:
1)
Error:Library reading phase: Type javax.inject.Named from file
'C:\Users\nicholas\AndroidStudioProjects\BaseIntegrations\app\build\intermediates\jill\debug\packaged\javax.inject-2.4.0-b10-e2682135301b663484690f1d3a4a523bcea2a732.jar'
has already been imported from file
'C:\Users\nicholas\AndroidStudioProjects\BaseIntegrations\app\build\intermediates\jill\debug\packaged\javax.inject-1-4a242883e90a864db3b80da68e11a844f842d2df.jar',
type 'javax.inject.Named' (see property 'jack.import.type.policy' for
type collision policy)
2)
Error:com.android.jack.JackAbortException: Library reading phase: Type
javax.inject.Named from file
'C:\Users\nicholas\AndroidStudioProjects\BaseIntegrations\app\build\intermediates\jill\debug\packaged\javax.inject-2.4.0-b10-e2682135301b663484690f1d3a4a523bcea2a732.jar'
has already been imported from file
'C:\Users\nicholas\AndroidStudioProjects\BaseIntegrations\app\build\intermediates\jill\debug\packaged\javax.inject-1-4a242883e90a864db3b80da68e11a844f842d2df.jar',
type 'javax.inject.Named' (see property 'jack.import.type.policy' for
type collision policy)
3)
Error:com.android.jack.backend.jayce.TypeImportConflictException: Type
javax.inject.Named from file
'C:\Users\nicholas\AndroidStudioProjects\BaseIntegrations\app\build\intermediates\jill\debug\packaged\javax.inject-2.4.0-b10-e2682135301b663484690f1d3a4a523bcea2a732.jar'
has already been imported from file
'C:\Users\nicholas\AndroidStudioProjects\BaseIntegrations\app\build\intermediates\jill\debug\packaged\javax.inject-1-4a242883e90a864db3b80da68e11a844f842d2df.jar',
type 'javax.inject.Named' (see property 'jack.import.type.policy' for
type collision policy)
4)
:app:compileDebugJavaWithJack FAILED
Error:Execution failed for task ':app:compileDebugJavaWithJack'.
java.io.IOException: com.android.jack.api.v01.CompilationException: Library reading phase: Type javax.inject.Named from file 'C:\Users\nicholas\AndroidStudioProjects\BaseIntegrations\app\build\intermediates\jill\debug\packaged\javax.inject-2.4.0-b10-e2682135301b663484690f1d3a4a523bcea2a732.jar' has already been imported from file 'C:\Users\nicholas\AndroidStudioProjects\BaseIntegrations\app\build\intermediates\jill\debug\packaged\javax.inject-1-4a242883e90a864db3b80da68e11a844f842d2df.jar', type 'javax.inject.Named' (see property 'jack.import.type.policy' for type collision policy)
Here is the app level build.gradle:
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.nicholas.baseintegrations"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
useLibrary 'org.apache.http.legacy'
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile project(path: ':backend', configuration: 'android-endpoints')
compile "com.getbase:basecrm-java:1.4.3"
compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.android.support:palette-v7:24.2.0'
compile 'com.android.support:cardview-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.21'
compile group: 'org.glassfish.jersey.media', name: 'project', version: '2.23.2', ext: 'pom'
}
All help is very appreciated, as I know this is a new things, but cannot seem to find questions regarding the Jack/J8 build process. Thanks in advance.

We're looking into this, I think it's due to different behavior of the Android Gradle plugin for Jack and javac. As a workaround, you can try this in jackOptions
additionalParameters = [ "jack.import.type.policy" : "keep-first" ]
But be aware that with that option, Jack will keep the first definition of the class it encounters.
You can track our progress here: https://code.google.com/p/android/issues/detail?id=222273

I ended up solving this build issue. One of my dependencies was adding a second javax.inject library which was throwing these build errors saying that the javax.inject jar had already been imported from a previous one.
So I had javax.inject-1 and javax.inject-2.4.0-b10. I ended up excluding the javax.inject module from one of my dependencies and it cleared up issues with the build and is working jsut fine now.
Here is the dependencies section of my app build.gradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile project(path: ':backend', configuration: 'android-endpoints')
compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.21'
compile (group: 'org.glassfish.jersey.media', name: 'project', version: '2.23.2', ext: 'pom')
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile ('com.getbase:basecrm-java:1.4.3') {
exclude (group: 'javax.inject', module: 'javax.inject')
}
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:palette-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
}
And you can see the group exclusion in the basecrm dependency. So if anyone else has this issue just watch out for duplicate External Libraries coming from some dependency import.

I met the same problem,Then I found a same package in these two jar,But them are not a same version.
So modify to them have a same version.

Related

Error Annotation Processors must be explicitly declared now

Suddenly i got an error in the execution of the app.
I know that this qustion was already asked here: Annotation processors must be explicitly declared now
However the solution don't answer the problem :(
this is my build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 26
buildToolsVersion '27.0.0'
aaptOptions {
cruncherEnabled = true
}
defaultConfig {
applicationId "com.freelance.crdzbird_dev.clarobadge"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
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 "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.+'
compile 'com.android.support:support-v4:26.+'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.github.javiersantos:MaterialStyledDialogs:2.1'
annotationProcessor 'com.google.auto.value:auto-value:1.1'
compile 'ai.api:libai:1.4.8'
compile 'ai.api:sdk:2.0.7#aar'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'io.mattcarroll.hover:hover:0.9.8'
compile 'com.gjiazhe:MultiChoicesCircleButton:1.0'
compile "org.apache.logging.log4j:log4j-core:2.8"
compile 'com.sackcentury:shinebutton:0.1.9'
compile 'com.yalantis:contextmenu:1.0.7'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.dlazaro66.qrcodereaderview:qrcodereaderview:2.0.2'
compile 'me.samthompson:bubble-actions:1.3.0'
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.github.apl-devs:appintro:v4.2.2'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
compile 'com.google.firebase:firebase-messaging:10.2.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
repositories {
mavenCentral()
Anyone knows how can this error be solved. I search in google without success.
This is the error that recieve
Error:Execution failed for task ':app:javaPreCompileDebug'.
> Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration.
- log4j-core-2.8.jar (org.apache.logging.log4j:log4j-core:2.8)
Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior. Note that this option is deprecated and will be removed in the future.
See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details.
That user's error said this annotation processor was missing auto-value-1.1.jar (com.google.auto.value:auto-value:1.1), and the answer was to add:
annotationProcessor 'com.google.auto.value:auto-value:1.1'
Your error says log4j-core-2.8.jar (org.apache.logging.log4j:log4j-core:2.8) so you thought the answer was to add this?
annotationProcessor 'com.google.auto.value:auto-value:1.1'
You've copied it verbatim! Of course it won't work! Change the annotation processor to the one you're actually using.
Cough cough cough annotationProcessor 'org.apache.logging.log4j:log4j-core:2.8'
Please Add this to your build.gradle
testImplementation('org.robolectric:robolectric:4.3.1') {
// https://github.com/robolectric/robolectric/issues/5245
exclude group: 'com.google.auto.service', module: 'auto-service'
}
Like this
After that clean Project and Build
Hope it Helps

Error:(58, 27) error: cannot access zzanb class file for com.google.android.gms.internal.zzanb not found [duplicate]

UPD. I have read these question and answer (Class file for com.google.android.gms.internal.zzaja not found). But I doesnt understand what strings i need to add or remove in my project.
Because I havent this and other strings in my code:
compile 'com.google.android.gms:play-services-location:9.2.0'
I develop an android app with use of FireBase. And when I want to build my project I have an error:
Error:(39, 25) error: cannot access zzanb
class file for com.google.android.gms.internal.zzanb not found
The error was caused by invoking statement: FirebaseAuth.getInstance().getCurrentUser();
Projects 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:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Modules build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "xxx.yyy.zzz"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.google.firebase:firebase-core:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.1.0'
compile 'com.firebaseui:firebase-ui:0.6.0'
compile 'com.android.support.test.espresso:espresso-core:2.2.2'
}
apply plugin: 'com.google.gms.google-services'
Please, help me to solve that error)
P.S I have already read that question (Firebase Error cannot access zzanb after using play-services-xxx:9.8.00), but i didnt understand anything, what i need to add or remove from my build.gradle files in my situation.
You're mixing libraries from old and new Firebase released. Everything from Firebase that you use should be in parity. This line is reference an library from a very old Firebase release (before it became the Firebase platform at Google):
compile 'com.firebaseui:firebase-ui:0.6.0'
If you want to use the Firebase-UI library, you should use the new version of it that matches the version of the main client library you're using. You're using 10.0.1, so according to the table on the Firebase-UI github I just linked, you want this dependency:
compile 'com.firebaseui:firebase-ui:1.1.1'
Always make sure your Firebase-UI library matches the core Firebase SDK you're using.
It looks like in your case Doug's fix resolved your issue, but we recently encountered the same problem with a different root cause.
In our case, we had configured our IDE project to use JDK8 but failed to check which version of the JDK was in use in the terminal. Because React Native runs Gradle from the command line when you type 'react-native run-android' Gradle was attempting to build using JDK10 which caused obvious issues since Android currently only supports up to JDK8. Once we configured the terminal to use JDK8 the issue was resolved.
TL;DR: Check what version of the JDK you are using in the terminal.
Getting following error:
error: cannot access zza
class file for com.google.android.gms.common.internal.safeparcel.zza not found
dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-analytics:17.0.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
/* implementation 'com.google.firebase:firebase-core:9.2.0' // this line must be included to integrate with Firebase
implementation 'com.google.firebase:firebase-messaging:10.2.1' // this line must be included to use FCM*/
//implementation 'com.google.android.gms:play-services:10.2.1'
implementation 'com.google.android.gms:play-services-maps:10.2.1'
implementation 'com.google.firebase:firebase-core:10.2.1'
implementation 'com.google.firebase:firebase-messaging:10.2.1'
}

In Android studio 2.2.1 java.bean.* not found

I am trying to use opencsv library jar file but while importing i am getting the error message saying "Fail to load plugin descriptor from file *.jar".
I checked for META-INF/plugin.xml file inside the jar, but there is none.
So, i am now importing the source code of opencsv. I am getting error with java 7 api used within the library source code. All the usages of 'java.bean.*' package is giving 'cannot find symbol' error.
Following is the build.gradle file content:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.amadeus.jbisht.mytestproject"
minSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.+'
testCompile 'junit:junit:4.12'
}
Please let me know what am I missing here. I can see it listed under 'External Libraries' but android studio isnt picking it up.
Gradle dependencies are the way to go:
compile group: 'com.opencsv', name: 'opencsv', version: '3.8+'
E.g.,
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile group: 'com.opencsv', name: 'opencsv', version: '3.8+'
}
Gradle will automatically import the required files and integrate the library.
opencsv need some java.bean libraries, but they are not included in the Android SDK.
To resolve this :
download sources of opencsv
download openbean
include both in your Android Studio project
replace java.bean.* dependancies by localpath.bean.* in opencsv sources

java.lang.NoClassDefFound error javax Gmail API

I'm running into an exception in a gmail client I'm working on. The exception is the
java.lang.NoClassDefFound that is triggered on the getDefaultInstance line
Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
I've included the javax jar as follows:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.google.android.gms:play-services:7.3.0'
compile 'com.google.api-client:google-api-client:1.20.0'
compile 'com.google.api-client:google-api-client-android:1.20.0'
compile 'com.google.api-client:google-api-client-gson:1.20.0'
compile 'com.google.apis:google-api-services-gmail:v1-rev29-1.20.0'
compile 'javax.mail:javax.mail-api:1.5.2'
}
I've googled this but not quite sure how to fix this. I've tried clean and rebuild and in both cases the exception is still thrown. Any help would be appreciated.
Exeception detail Message:
Didn't find class "com.sun.mail.util.MailLogger" on path: DexPathList[[zip file "/data/app/com.android.application.androidgmailclient-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
UPDATE
I found that the missing class "MailLogger" is not a part of the javax.mail-api rather it is a part of the 'javax.mail:mail:1.5.0-b01' jar with 1.5.0-b01 being the latest version:
http://mvnrepository.com/artifact/javax.mail/mail/1.5.0-b01
So I included the compile 'javax.mail:mail:1.5.0-b01' into my gradle file and then I found the jar in the external libraries. I copied the jar into app/libs and then hit "Add as Library". I can see that the MailLogger class is now present which is what was bombing in the exception. My gradle file now looks like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc2"
packagingOptions{
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
defaultConfig {
applicationId "com.android.app.androidgmailclient"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.google.android.gms:play-services:7.3.0'
compile 'com.google.api-client:google-api-client:1.20.0'
compile 'com.google.api-client:google-api-client-android:1.20.0'
compile 'com.google.api-client:google-api-client-gson:1.20.0'
compile 'com.google.apis:google-api-services-gmail:v1-rev29-1.20.0'
compile 'javax.mail:mail:1.5.0-b01'
compile files('libs/mail-1.5.0-b01.jar')
}
However, when I go to build the project now I get this build error:
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
Any ideas?
Not sure if you solved this already, but I found you need to use an Android specific Java Mail library.
compile 'com.sun.mail:android-mail:1.5.5'
compile 'com.sun.mail:android-activation:1.5.5'
I was running into your error and other similar ones using the latest Java Mail libraries but switching to these fixed all of them.
https://java.net/projects/javamail/pages/Android
Android Studio: NoClassDefFoundError
This error occurred because you are adding same library twice.
compile 'javax.mail:mail:1.5.0-b01'
compile files('libs/mail-1.5.0-b01.jar')
delete one of these line then I think it should work fine.
I assume you have compiled your code successfully, but got a runtime exception. You need to include the jar files in the final package. Have a look at this one, and this one.

Apache Fluent Client's transitive dependency on HttpClient causes NoClassDefFoundExceptions

I have the following gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/DEPENDENCIES'
}
defaultConfig {
applicationId "com.guesstheurf.guesstheurf"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile (
[group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.5.0'],
[group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.5.0'],
[group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.5.0']
)
compile ('org.apache.httpcomponents:fluent-hc:4.4.1')
}
When I build this, I get warnings stating
Dependency org.apache.httpcomponents:httpclient:4.4.1 is ignored for release as it may be conflicting with the internal version provided by Android.
This is a dependency relied on by httpcomponents:fluent-hc.
I found this source on dependency management(chapter 51.4.7: Excluding transitive dependencies) that indicates I can just exclude the transitive dependency that causes the conflict.
However when I change it to
compile ('org.apache.httpcomponents:fluent-hc:4.4.1') { exclude module: 'httpclient' }
the Gradle warning is indeed gone, but the problem still persists:
Caused by: java.lang.NoClassDefFoundError: org.apache.http.client.fluent.InternalEntityEnclosingHttpRequest
at org.apache.http.client.fluent.Request.Post(Request.java:95)
The issue stays when I use
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
as indicated in this answer.
When I use
configurations {
all*.exclude module: 'httpclient'
}
the warning is gone as well, though the runtime error persists.
This source which suggests to force my own version using force = true doesn't fix the issue either.
Explicitly adding the httpclient-related dependencies as suggested here doesn't work either (and doesn't remove the warnings):
compile 'org.apache.httpcomponents:httpclient:4.4.1'
compile 'org.apache.httpcomponents:fluent-hc:4.4.1'
compile "org.apache.httpcomponents:httpmime:4.4.1"
compile 'org.apache.httpcomponents:httpcore:4.4.1'
How can I get fluent-hc to work? And why doesn't it simply select the newest version of the httpclient package since that is the default resolution strategy according to 51.2.3 Resolve version conflicts?
And why doesn't it simply select the newest version of the httpclient
package since that is the default resolution strategy according
Because Android ships with an extremely outdated (pre-BETA1) version of HttpClient 4.0, which makes it impossible to use any version of stock HttpClient. Gradle plugin is apparently smart enough to warn you about incompatibility and possible conflicts.
You have two options here:
use official Android port of HttpClient, which is API compatible with the version shipped with Android by default
dependencies {
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
compile group: 'org.apache.httpcomponents' , name: 'fluent-hc' , version: '4.3.5'
}
Repackage HttpClient into a different name space using scripts developed by Dirk Boye. Your mileage with the latest releases of HttpClient may vary.
org.apache.http -> thank.you.google.org.apache.http
Seems like when building with Android Studio 1.4 for API 23, this line causes "Failed to resolve" error:
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
Use this instead:
compile group: 'cz.msebera.android' , name: 'httpclient', version: '4.4.1.1'
Download the jar here: http://mvnrepository.com/artifact/cz.msebera.android/httpclient/4.4.1.1

Categories