Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate an .apk file from Xamarin.Forms Project using Visual Studio?

I have a Xamarin.Forms project that I'd like to distribute as an apk; however I cannot find how to generate a .apk file in Visual Studio - how would I do this?

like image 714
Wassim Avatar asked Aug 09 '16 15:08

Wassim


People also ask

How do I get an APK file from xamarin?

To create the APK file, right-click the Xamarin. Android project in the Solution Explorer and select Archive... This will open the Archive manager and begin archiving the project, preparing to create the APK file. When it finishes archiving the project, click in Distribute... to proceed.

How can I create APK file in Android Studio?

In the menu bar, click Build > Generate Signed Bundle/APK. In the Generate Signed Bundle or APK dialog, select Android App Bundle or APK and click Next. Below the field for Key store path, click Create new.

Can we build APK in VS Code?

Yes, you can generate an apk file with VS Code.


2 Answers

When using Visual Studio 2015 Update 3 with the latest Xamarin tools (which is v4.2.2.6 when writing this answer), right click your Android project and select "Archive..." as described here:

https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing_an_application/part_1_-_preparing_an_application_for_release/#Compile

This will open the Archive Manager and begins the process of archiving the App bundle. When the archiving is finished, you can click on the button "Distribute..." at the right bottom corner of the Archive Manager to create a signed APK. This is described here:

https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing_an_application/part_2_-_signing_the_android_application_package/

Note: if you do not use a signed APK, you will probably get a parse error if try to install on an Android device.

like image 72
Maikel Willemse Avatar answered Sep 21 '22 16:09

Maikel Willemse


Try The Following Steps:

  1. You need to change Your Project Mode from debug to release.

  2. Rebuild your project.

  3. Go to Solution Explorer -> Android project (right click) --> Archive --> Distribute -- AdHoc --> Sign & Add Details --> Save As

The APK is Ready To Publish in Play Store

like image 38
Mohamad Mahmoud Avatar answered Sep 21 '22 16:09

Mohamad Mahmoud