Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi 11 app in Android Play Store shows warning: Non-SDK API

The "Pre-launch report overview" in "Google Play Console" shows this warning:

Type:

Non-SDK API

API:

Landroid/view/MotionEvent;-><init>()V

Stack trace:

StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/view/MotionEvent;-><init>()V

This error has previously been fixed in Delphi 10.3, see https://quality.embarcadero.com/browse/RSP-22046 but its now back in Delphi 11?

The solutions I can find on Google is about setting a newer targetSdkVersion in the AndroidManifest.xml However, we already set it to API level 30, as it is required to deploy to the new Play Store. In AndroidManifest.xml we have:

<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="30" />

Anyone having seen this error lately with a "Delphi 11" app on Play Store? - and eventually having found a solution?

like image 526
Hans Avatar asked Nov 05 '22 23:11

Hans


1 Answers

What happened here is that the root of the problem (i.e. referencing the parameter-less constructor for android.view.MotionEvent) has not been really solved but rather workaround-ed by making the default target API level = 28 on Delphi 10.3.1. With this the warning dialog no longer shows on screen but you can still see the non-SDK warning by using the Monitor tool with your device set up for USB debugging.

like image 55
Alex Sawers Avatar answered Nov 13 '22 15:11

Alex Sawers