Skip to content

Apache HTTP Client Deprecation #179

@JoshuaHintze

Description

@JoshuaHintze

I was finding that the gradle file uses a library that has been deprecated and in order to use it you have to adjust your AndroidManifest.xml

See this link:

https://developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p

Apache HTTP client deprecation
With Android 6.0, we removed support for the Apache HTTP client. Beginning with Android 9, that library is removed from the bootclasspath and is not available to apps by default.

To continue using the Apache HTTP client, apps that target Android 9 and above can add the following to their AndroidManifest.xml:


<uses-library android:name="org.apache.http.legacy" android:required="false"/>

Note: The android:required="false" attribute is required for apps that have a minimum SDK of 23 or lower, because on devices with API levels lower than 24, the org.apache.http.legacy library is not available. (On those devices, the Apache HTTP classes are available on the bootclasspath.)
As an alternative to using the runtime Apache library, apps can bundle their own version of the org.apache.http library in their APK. If you do this, you must repackage the library (with a utility like Jar Jar) to avoid class compatibility issues with the classes provided in the runtime.

When I added <uses-library android:name="org.apache.http.legacy" android:required="false"/> to my AndroidManfiest.xml it works as expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions