Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android App Licensing crashes on Android Pie

The error says URLEncodedUtils is not found. Is there a workaround.

Caused by java.lang.ClassNotFoundException
    Didn't find class "org.apache.http.client.utils.URLEncodedUtils" on path: DexPathList[[zip file "/data/app/com.app.p-MY70To6m946K0_uiYLCsSg==/base.apk"],nativeLibraryDirectories=[/data/app/com.app.p-MY70To6m946K0_uiYLCsSg==/lib/arm64, /data/app/com.app.p-MY70To6m946K0_uiYLCsSg==/base.apk!/lib/arm64-v8a, /system/lib64]]
like image 454
mihirjoshi Avatar asked Aug 25 '18 19:08

mihirjoshi


1 Answers

The Apache libraries have been removed. If you were previously using

useLibrary 'org.apache.http.legacy 

in your build.gradle, it no longer works in Android Pie.

Instead, you have to add

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

to your AndroidManifest.

See here for official release notes

like image 186
amit Avatar answered Nov 11 '22 10:11

amit