question

DonGlover-0631 avatar image
0 Votes"
DonGlover-0631 asked ·

Setting the Android API level

I am trying to upload my app to Google Play for Release. I have built and signed my .apk. When I go to upload it I got the following error:

Your app currently targets API level 28 and must target at least API level 29 to ensure it is built on the latest APIs optimized for security and performance. Change your app's target API level to at least 29.

I have updated my TargetFrameWork
41649-target-frame-work.png



I have updated my AndroidManifest

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

I have gone as far as to delete all release and debug build folders both in the shared project and the android project.

But, when I build the app and .apk and then try and upload it I still get the same error.

What am I missing?

dotnet-xamarinformsdotnet-android
· 8
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

First of all, please update all your nuget packages to the latest and delete the bin and obj folder, rebuild your project. Then do you have Xamarin.Android library project (such as a class library or a bindings library)? If so, you should configure the Target Framework as well.

0 Votes 0 ·

Thanks
I just went through and uninstalled and reinstalled the packages.

The issue persists.

(And I don't have a class library or bindings library)

0 Votes 0 ·

Please open your project folder, delete all of bin and obj folders(xxxx, xxxx.Android, xxxx.iOS folders have this bin and obj folder),

0 Votes 0 ·
Show more comments

These are my installed packages. Do any of them stand out as problematic?

41898-installed.png


0 Votes 0 ·
installed.png (93.7 KiB)
Cheesebaron avatar image
0 Votes"
Cheesebaron answered ·

In the Application tab in your screenshot. There you also need to change the TargetFramework to target Android 10.

If you still are using packages.config instead of PackageReference to manage NuGet packages. You will need to remove the NuGet packages and add them again or manually update the entries in there to grab stuff for the correct target.

So you need to update:
- TargetFramework
- AndroidManifest
- If you are using PackageReference clean bin/obj
- If you are using packages.config, remove all packages and add them back or manually update packages.config to point at correct TFM in nuget package


· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks.
I am a little confused by your answer.
The screenshot is of the Application tab and that shows it as being set to Android 10.

So, as noted above:
I updated the TargetFramewok.
I updated the manifest
I deleted the contents of the bin and obj folders.

i am not sure about the PackageReference vs packages.config item so I will have to dig further on that.

I just went through and uninstalled and reinstalled the packages.

The issue persists.



0 Votes 0 ·
DonGlover-0631 avatar image
0 Votes"
DonGlover-0631 answered ·

Ok, this turned out to be user (me) stupidity. I have resolved the issue.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.