Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apache HTTP Client Deprecation #179

Open
GimpMaster opened this issue Dec 29, 2020 · 0 comments
Open

Apache HTTP Client Deprecation #179

GimpMaster opened this issue Dec 29, 2020 · 0 comments

Comments

@GimpMaster
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant