Android Question This app was built for an older version of android...

avalle

Active Member
Licensed User
Longtime User
Hi all,
I'm testing a small app with multiple devices and I get the following warning when launching the app on a Galaxy S10 with Android 10: "This app was built for an older version of android and may not work correctly. Try to check the availability of updates or contact the developer". (note: this translation is mine from the native OS language).
The app works as expected, but I would like to remove this warning before posting it to the PlayStore.

My application is rather simple, just sending a receiving messages via UDP. using android.permission.INTERNET due to UDPSocket.
Compiled with B4A 10.2 / Android SDK 30 / Java 8_172 64 bit
Libraries: Core 9.90 + Network 1.52

Here's the manifest I'm using:
Manifest:
AddManifestText(
<uses-sdk android:minSdkVersion="14" />
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"
    android:targetSdkVersion="29"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")

Anything odd I'm missing or ignoring?
Thanks
Andrea
 

avalle

Active Member
Licensed User
Longtime User
Indeed I'm using the recommended android:targetSdkVersion="29"

In addition I also tried with android:targetSdkVersion="30" as I'm using Android SDK 30, and B4A gives me the warning "The recommended value for android:targetSdkVersion is 29 or above (manifest editor). (warning #31)", which does not seem correct. Sounds like a B4A bug?
 
Upvote 0

avalle

Active Member
Licensed User
Longtime User
Looks like I solved by modifying the Manifest to this:
Manifest:
AddManifestText(
<uses-sdk android:minSdkVersion="14" />
<uses-sdk android:targetSdkVersion="29" />
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")

I wonder what's the difference between setting targetSdkVersion as <uses-sdk> and <supports-screens>, which has worked for me so far prior to Android 10.
 
Upvote 0

avalle

Active Member
Licensed User
Longtime User
That makes sense @agraham but I want to notice that the B4A IDE seems to consider it as valid, or at least the warning message is removed even with targetSdkVersion in the wrong place.
 
Upvote 0

avalle

Active Member
Licensed User
Longtime User
I started from an old project with the wrong string. Now I see that the IDE builds a default manifest if I clean it up.
I learned something new for me, thanks everyone for taking the time to answer my question.
 
Upvote 0
Top