Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (2023)

  • Article

The most common way to distribute Android applications to users is Google Play. When an application is submitted to Google Play for the first time, it must be submitted through the Google Play Console. Subsequent versions of the application can be submitted through Visual Studio. In both cases, a Google Play developer account is required. Apps submitted to Google Play require Google's approval.

To distribute a .NET Multiplatform Application UI (.NET MAUI) Android application, you must sign it with a key from your keystore before uploading it to Google Play. A keystore is a binary file that serves as a repository for certificates and private keys.

Google Play requires you to make your app oneAndroid-App-Package(AAB). Google Play uses your app bundle to generate and deploy an optimized Android package (APK) for each device configuration, downloading only the code and resources required for a specific device to run your app. For more information on Android app bundles, seeAbout Android app bundlesat developer.android.com.

The process to distribute a .NET MAUI Android application via Google Play is as follows:

  1. Create a Google Play developer account. For more information, seeCreate a Google Play developer account.
  2. Build your app in the Google Play Console. For more information, seeBuild your app in the Google Play Console.
  3. Set up your application in the Google Play Console. For more information, seeSet up your app in the Google Play Console.
  4. Make sure your app uses the correct packaging format. For more information, seeMake sure the packet format is correct.
  5. Build and sign your app in Visual Studio, then distribute it through the Google Play Console. For more information, seeDistribute your app through the Google Play Console.

Subsequent versions of the app can then be published through Visual Studio. For more information, seeDistribute your application with Visual Studio.

Create a Google Play developer account

To publish an Android app to Google Play, you need to create a Google Play developer account:

  1. Sign in with your Google account for aGoogle Play developer account.
  2. Enter information about your developer identity.
  3. During the registration process you will need to review and accept thisGoogle Play Developer Distribution Agreement.
  4. There is a one-time registration fee of $25.
  5. Follow the instructions in the confirmation email to verify your identity.

important

Authentication must be completed before apps can be published through Google Play.

After creating your Google Play developer account, you can start publishing your application to Google Play.

For more information, seeSign up for a Google Play developer accountat support.google.com.

Build your app in the Google Play Console

After creating a Google Play developer account, you need to create an app in the Google Play Console:

  1. Sign in to yourGoogle Play developer account.

  2. existGoogle Play Console, existall applicationstab, selectcreate applicationTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (1)

  3. withincreate applicationpage, enter your application data and selectcreate applicationTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (2)

For more information on creating applications in the Google Play Console, seeBuild and set up your applicationat support.google.com.

Set up your app in the Google Play Console

After you've created your application, you should set it up. Your application's dashboard guides you through all the important steps.

To start setting up your application, choosedashboardin the left menu. Under App Details at the top of the page, you'll find various categories and tasks related to app setup and publishing. Before you can launch your application on Google Play, you must complete mandatory tasks. When you complete a task, you'll see a green check mark and strikethrough text. The progress bar at the top of the section will also update. For more information, seeSet up your app in the app dashboardat support.google.com.

Make sure the packet format is correct

To publish a .NET MAUI Android application for distribution on Google Play, your application packaging format is AAB, the default packaging format for release builds. To verify that your app's packaging format is set correctly:

  1. in Visual Studiosolution researcherRight-click and select your .NET MAUI Application projectcharacteristic.Then navigate toAndroid > Optionstab and make surereleasefield is set tobundle up:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (3)release

Distribute your app through the Google Play Console

When an AAB is submitted to Google Play for the first time, it must be uploaded manually through the Google Play Console. This allows Google Play to match the key signing in all future bundles to the original key used by the first version of the app. To upload an app through the Google Play Console, it must first be built and signed in Visual Studio.

To build and sign your application in Visual Studio:

  1. On the Visual Studio toolbar, use thedebug targetdropdown selectionAndroid-EmulatorThen the emulator of your choice:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (4)

  2. On the Visual Studio toolbar, use thesolution configurationDrag down to switch from debug configuration to release configuration:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (5)

  3. existsolution researcher, right click on your .NET MAUI application project and selectrelease...:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (6)

    Thefilewill open and Visual Studio will start archiving your application package:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (7)

  4. withinfileAfter archiving has completed successfully, make sure your archive is selected, then choosedistribute...Click the button to start distributing your application:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (8)

    TheDistribution – select channelA dialog box appears.

  1. withinDistribution – select channelSelect dialog boxin additionTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (9)

  2. withinDistribution - Identity signingSelect dialog box+Button to create a new signature identity:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (10)

    TheCreate an Android keystoreA dialog box appears.

    Remarks

    Alternatively, you can select theimportTaste.

  3. withinCreate an Android keystoreIn the dialog box, provide the required information to create a new signing identitykey store, then selectcreateTaste:

    • alias. Enter an identifying name for the key.
    • Password. Create and confirm a strong password for your key.
    • Effectiveness. Set the period (in years) your key is valid for.
    • Full Name, Organizational Unit, Organization, City or Locality, State or Province, and Country Code. This information is not displayed in your application, but is included in your certificate.

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (11)

    A new keystore with the new certificate is savedC:\Users{username}\AppData\Local\Xamarin\Mono for Android\Keystore{Alias}{Alias}.keystore.

    important

    The keystore and password are not stored in your Visual Studio solution. So make sure you back up this data. If you lose it, you won't be able to sign your app with the same signing identity.

  4. withinDistribution - Identity signingIn the dialog box, select your newly created signing identity and chooseSave asTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (12)

    ThefileDisplays the publishing process.

  5. withinSave asDialog box to confirm your save location and file name.AABFile is correct and selectsave on computerTaste.

  6. withinSignaturpasswortIn the dialog box, enter your signing identity password and selectOKTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (13)

  7. withinfile, chooseinitial public offeringButton after the publishing process is complete:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (14)

    Visual Studio opens the folder containing the published application.

The published application can then be published to Google Play via the Google Play Console. To do this, you must first create a build in the Google Play Console. A release is a combination of one or more application versions that you prepare to launch the application or provide an update. You can create releases on the following tracks:

  • Internal test. Private test builds are available for up to 100 testers of your choice.
  • Closed Beta. Closed beta builds are available to a limited number of testers of your choosing who can test pre-release versions of your app and provide feedback.
  • Open the test. Open beta builds are available to testers on Google Play. Users can participate in the test from your store listing.
  • Production. The production release is available to all Google Play users in the country of your choice.

For more information on creating editions in the Google Play Console, seeprepare and publish a versionat support.google.com.

important

Apps submitted to Google Play usually go through a review process. For more information, seePrepare your app for reviewAndPublish your appat support.google.com.

Distribute your application with Visual Studio

An AAB must be submitted to Google Play and verified before it can be distributed through Visual Studio. If you try to distribute an AAB from Visual Studio that wasn't first uploaded from the Play Console, you'll get the following error:

Google Play requires you to manually upload your first package (APK/AAB) for this app. You can use a temporary package for this.

If you encounter this error, please upload the AAB manually via the Google Play Console. Subsequent versions of the application can then be published through Visual Studio. However, the version code of the app must be changed with each upload, otherwise the following error occurs:

AAB with version code (1) has been uploaded.

To resolve this error, rebuild the application with a different version number and resubmit it to Google Play through Visual Studio.

Remarks

The application version number can be updated by increasing the valueApp VersionApply the integer attribute in the project file.

To upload your app from Visual Studio to Google Play, you must first set up API access in the Google Play Console.

Enable Google API access

The Google Play Developer Publishing API allows Visual Studio to upload new versions of your application to Google Play. Before Visual Studio can make API calls, you must set up API access in your Google Play developer account. To do this, you must link your Google Play Developer account to your Google Cloud project and configure access to the Google Play Developer Publishing API using an OAuth client.

To enable Google API access:

  1. Sign in to yourGoogle Play developer account.

  2. existGoogle Play Console, expandset upSelect and select itemAPI access.then inAPI accessside, chooseSelect an item to link toTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (15)

    To use the Google Play Developer API, you need a Google Cloud project, which must be associated with your Google Play Developer account.

    Remarks

    A Google Play developer account can only be associated with one Google Cloud project. Therefore, if you publish multiple applications from a single Google Play developer account, they must all use the same Google Cloud project.

  3. withinAPI accessside, chooseCreate a new Google Cloud projectradio button followed bysave on computerTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (16)

    A new Google Cloud project is created and linked to your Google Play developer account.

  4. withinAPI accessside, atOAuth-Clientselect sectionConfigure the OAuth consent screen:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (17)

  5. withinOAuth consent screenpage, select the desired user type radio button and select thatcreateTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (18)

    For more information on user types, seeuser typeat support.google.com.

  6. withinEdit the application registrationpage, fill in the fields marked as required and selectsave and continueTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (19)Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (20)

  7. withinEdit the application registrationside, chooseAdd or remove areasTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (21)

  8. withinUpdate selectionPop-up window, choose./auth/androidpublisherarea in the table and selectrenewTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (22)

    Remarks

    The other ranges in the table are optional as they are standard ranges.

  9. withinEdit the application registrationside, choosecertificateLabel:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (23)

  10. withincertificateside, choose+ Create certificatebutton, then theOAuth-Client-IDDing:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (24)

  11. withinCreate an OAuth Client IDside, choosedesktop applicationwithinApp Typepull down, enterstudio visualswithinNamefield and select itcreateTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (25)

  12. withinOAuth client createdSelect dialog boxDownload JSONClick the Data button to download your Client ID and Client Secret. This will be needed later. then clickOKClick the button to close the dialog.

For more information on enabling Google API access to your Google Play developer account, seeStartedat developers.google.com. For more information on setting up an OAuth consent screen, seeSet up your OAuth consent screenat support.google.com.

Upload your app through Visual Studio

To build and sign your application in Visual Studio:

  1. On the Visual Studio toolbar, use thedebug targetdropdown selectionAndroid-EmulatorThen the emulator of your choice:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (26)

  2. On the Visual Studio toolbar, use thesolution configurationDrag down to switch from debug configuration to release configuration:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (27)

  3. existsolution researcher, right click on your .NET MAUI application project and selectrelease...:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (28)

    Thefilewill open and Visual Studio will start archiving your application package:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (29)

  4. withinfileAfter archiving has completed successfully, make sure your archive is selected, then choosedistribute...Click the button to start distributing your application:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (30)

    TheDistribution – select channelA dialog box appears.

  1. withinDistribution – select channelSelect dialog boxGoogle PlayTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (31)

  2. withinDistribution - Identity signingIn the dialog box, select the signing identity that you created when creating your application for distribution through the Google Play Console, and then selectkeep goingTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (32)

  3. withinDistribution – Google Play AccountSelect dialog box+Button to add your Google Play Developer account details:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (33)

  4. withinSign up for Google API accessIn the dialog box, enter a Description, your OAuth Client ID and Client Secret and clickto registerTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (34)

    Remarks

    The account description allows registering multiple Google Play developer accounts and uploading applications to different Google Play developer accounts.

    A web browser will open.

  5. Sign in to your Google Play developer account in a web browser. After signing in, you may see a message that Google hasn't verified the application. In that case, select thatkeep goingTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (35)

  6. In a web browser, select thekeep goingRequest authorization button:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (36)

    The web browser receives a confirmation code.

    important

    Don't close your web browser.

  7. In Visual Studio, inDistribution – Google Play AccountSelect dialog boxkeep going:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (37)

  8. withinDistribution – Google Play TrackIn the dialog box, select the track you want to upload your application to. Google Play offers five ways to upload your application:

    • Internal should be used to quickly distribute your app for internal testing and quality assurance reviews.
    • Alpha should be used to upload an early version of your application for a small group of testers.
    • Beta should be used to upload a previous version of your application for more testers.
    • Production apps are fully distributed on the Google Play Store.
    • Custom should be used to test pre-release versions of the application with specific users by creating a list of testers by email address.

    important

    If you don't see the custom title, make sure you've created a version of the title in the Google Play Console. For more information, seeprepare and publish a versionat support.google.com.

    Select the track you want to upload your app to, then selectuploadTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (38)

    For more information on Google Play testing, seeSet up open, closed or internal testsat support.google.com.

  9. Visual Studio begins publishing your app to Google Play. InsideSignaturpasswortIn the dialog box, enter the password you created for the signing identity and selectOKTaste:

    Publish a .NET MAUI Android Application for Google Play Distribution - .NET MAUI (39)

    Visual Studio signs your application package and uploads it to Google Play.

    important

    Apps submitted to Google Play usually go through a review process. For more information, seePrepare your app for reviewAndPublish your appat support.google.com.

Top Articles
Latest Posts
Article information

Author: Edmund Hettinger DC

Last Updated: 06/17/2023

Views: 6000

Rating: 4.8 / 5 (58 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Edmund Hettinger DC

Birthday: 1994-08-17

Address: 2033 Gerhold Pine, Port Jocelyn, VA 12101-5654

Phone: +8524399971620

Job: Central Manufacturing Supervisor

Hobby: Jogging, Metalworking, Tai chi, Shopping, Puzzles, Rock climbing, Crocheting

Introduction: My name is Edmund Hettinger DC, I am a adventurous, colorful, gifted, determined, precious, open, colorful person who loves writing and wants to share my knowledge and understanding with you.