Building a distributable apk from the command line

YuukiYuuki USMember
edited November 2016 in Xamarin.Forms

Hello, I am trying to set up a Continuous Integration server, and require a command line solution to building an apk of a Xamarin.Forms solution.
I currently have iOS versions building successfully on a Mac machine, however I am unable to build an apk on a windows machine.

I have tried invoking MSBuild on the Droid proejct with:
/p:Configuration=${CONFIGURATION} /p:Platform="Any CPU" /t:SignAndroidPackage /property:ApplicationVersion=1.0.0.${SVN_REVISION} /p:OutputPath="${WORKSPACE}/src/Project/Project.Droid/bin/${CONFIGURATION}/"

using this results in a small apk that installs, but crashes on launch. using the "Archive" option results in a larger apk that works fine.

Any advice on what I am doing wrong?

Best Answer

Answers

  • JimBennettJimBennett GBXamarin Team, Insider, University, Developer Group Leader ✭✭✭✭

    Are you building a debug version - and if so is it using the shared mono runtime? If you do this you'll get a small app that will crash - when building to ship to devices you need to use a configuration without the shared mono runtime (this is just provided to make deployments smaller and faster during development)

  • YuukiYuuki USMember

    @JimBennett said:
    Are you building a debug version - and if so is it using the shared mono runtime? If you do this you'll get a small app that will crash - when building to ship to devices you need to use a configuration without the shared mono runtime (this is just provided to make deployments smaller and faster during development)

    I've disabled shared mono run-time for debug builds. the apk still builds successfully, but fails to start once installed.

  • YuukiYuuki USMember

    bump

    Anyone have any ideas on this?

Sign In or Register to comment.