What to use for Target Framework and Minimum Framework for Android Maui project

Sumit Gupta 46 Reputation points

User's image

When I select the Target Android Framework as available in dropdown (Android 14.0 API Level 34) it change the XML Tag in file as


But when I use same file to compile using Commant line it gives error as wrong framework is selected. However from within Visual studio it runs fine on emulator.

Why I need to compile from command line is because whatever settings I set when I try to make APK for review on real device (without using Visual studio as for client review in different country) I cannot get it working. With Xamarin I all the time create a RElease APK build and send to client and it works, but since we upgrade to Maui that doesn't seems like an option anymore. Command line as

dotnet publish <path> -f -c stuff seems working.

A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,066 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 37,751 Reputation points Microsoft Vendor


    For specifying the Android SDK version, it is more recommended that you add this property to AndroidManifest.xml in a native way.

    <manifest xmlns:android="
        <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" />

    For issues where setting up directly in Visual Studio changes the .NET version, it is more recommended that you report the issue to the Visual Studio team. You could refer to Report a problem with the Visual Studio product or installer.

    Best Regards,

    Alec Liu.

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful