Android Question Google Licensing Library Crashing SDK 30

RichardN

Well-Known Member
Licensed User
Longtime User
A mature application recently recompiled with Android Target SDK 30 now crashes on open with the following error message. It appears to relate to the licensing Library (v1.21)
** 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:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: java.lang.ClassNotFoundException: org.apache.http.client.utils.URLEncodedUtils
... 10 more
 

DonManfred

Expert
Licensed User
Longtime User

 
Upvote 1

RichardN

Well-Known Member
Licensed User
Longtime User
To clarify.... This application has previously been tested and updated to the Play store successfully a couple of months ago as MinSDK=4 TargetSDK=30 (required)

There are no calls to the usual culprits of ExternalStorage etc and permissions are only com.android.vending.CHECK_LICENSE and android.permission.INTERNET.

Now it has started crashing with the error above.
 
Upvote 0

RichardN

Well-Known Member
Licensed User
Longtime User
I have carefully been through the code but I see no reference to the SDK-30 issues mentioned in the posts above. Given that this app has already been compiled a few months ago with the same SDK without any coding changes it seems rather unlikely that any of these issues apply. I note from the code history that there have been SDK issues with this Library function before.... I needed to add this to the manifest before to fix a crash issue.
B4X:
AddApplicationText(
<uses-library
      android:name="org.apache.http.legacy"
      android:required="false" />)
Reluctantly I have removed the library and associated code and the issue has been resolved. I must now put my trust in the security provided by the Play Store!
 
Upvote 0
Top