Android Question [Solved] Licensing Library Crashes With Target SDK 28

RichardN

Active Member
Licensed User
I was just updating a legacy application with some AppCompat features before publishing to the Play Store with TargetSDK 28. The application employs the Licensing Library Version 1.21 which I believe is the latest.

If I conditional compile the demo version without the LC library code (demo version) it compiles OK. If I include the LC check in the compile but switch the targetSDK down to 27 it compliles OK.

The combination of Licence Check + TargetSDK 28 crashes on compile.

** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/utils/URLEncodedUtils;
at com.android.vending.licensing.ServerManagedPolicy.decodeExtras(ServerManagedPolicy.java:285)
at com.android.vending.licensing.ServerManagedPolicy.processServerResponse(ServerManagedPolicy.java:117)
at com.android.vending.licensing.LicenseValidator.handleResponse(LicenseValidator.java:208)
at com.android.vending.licensing.LicenseValidator.verify(LicenseValidator.java:168)
at com.android.vending.licensing.LicenseChecker$ResultListener$2.run(LicenseChecker.java:224)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.client.utils.URLEncodedUtils" on path: DexPathList[[zip file "/data/app/com.waterline.ecamresetsplus-9R4-1DzBb9MV-z_IktcafA==/base.apk"],nativeLibraryDirectories=[/data/app/com.waterline.ecamresetsplus-9R4-1DzBb9MV-z_IktcafA==/lib/arm64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 9 more
** Activity (main) Pause, UserClosed = true **
 

Erel

Administrator
Staff member
Licensed User
Does it work if you add this to the manifest editor:
B4X:
AddApplicationText(
<uses-library
      android:name="org.apache.http.legacy"
      android:required="false" />
)
 
Top