Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create apk file using Visual Studio 2015

I created a project click the button, it can run successfully on emulator. I try to install it on android mobile (Moto G), for that I search the (.apk file) in my project and it will locate it on bin/debug/filname.apk. In this bin folder, I have 2 apk file filename.apk and filename.signed.apk. I copied both apk file to my mobile and try to install filename.apk, but it failed to install and then I try to install filename.signed.apk it installed successfully. But when I try to open it on mobile it is force closing automatically.

I tried searching on google but didn't get any solution.

like image 873
user2865434 Avatar asked Aug 15 '15 19:08

user2865434


2 Answers

Right Click on the application name in Solution Explorer

Go To "Properties" > "Android Options"

uncheck "use shared runtime".

Save and that's it!!!

These step may have to be repeated, in case xamarin is updated again. The "Export Android Package (.apk)" on context menu will now be enabled and you can go ahead with creation of apk. Happy programming!!!

like image 161
Amar Saxena Avatar answered Sep 19 '22 12:09

Amar Saxena


Are you preparing your App to release to Google Play? Check out this link

Else

Open Project properties > Android Options

Set your configuration to "Release"

Under "Packaging" tab, untick:

  • User Shared Runtime
  • Generate one package (.apk) per selected ABI

*Under "Advanced" tab, untick:

  • x86
  • x86_64

*Make sure all arm are checked.

If you are using Visual Studio 2017 (15.0.0+26228.9), you can simply change the build to AppStore. Then deploy to your target device.

You can find 2 APKs generated by Visual Studio 2017:

/project-folder/bin/Release/my-app.apk
/project-folder/bin/Release/my-app-Signed.apk


Signed APKs are debug APK used by visual studio.

like image 41
ikibiki Avatar answered Sep 22 '22 12:09

ikibiki