I installed AS 3.0 Canary,imported an existing project, and while running gradle sync, i got this error:
Failed to resolve: org.apache.httpcomponents:httpclient:4.0.1
I tried cleaning the project, and that failed too. This was a part of the error:
Required by:
project :app > com.google.api-client:google-api-client-android:1.22.0 > com.google.http-client:google-http-client-android:1.22.0 > com.google.http-client:google-http-client:1.22.0
I looked at other questions, and it seems like httpclient was deprecated in API 23. But every solution presented in those questions doesn't seem to work.
What's even more confusing, is that it ran perfectly fine in AS 2.4 Preview 7, with targetSdkVersion
and compileSdkVersion
both set to 25.
Edit: I tried running it on the stable version of AS, and it seems to work fine. But i need the newer emulators on the preview versions.
Had the same problem. Ended up excluding "org.apache.httpcomponents", in my case, from "com.google.http-client:google-http-client:1.21.0".
Before:
compile 'com.google.http-client:google-http-client:1.21.0'
After:
compile ('com.google.http-client:google-http-client:1.21.0') {
exclude group: 'org.apache.httpcomponents'
}
I had the same problem. Putting this in the module build.gradle file, at root level, fixed that error.
configurations {
compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With