Forum Cross Platform with Xamarin

Building Android from the command line

ShmooShmoo USMember ✭✭

I have a Xamarin.Forms solution which contains the standard projects for iOS and Android, as well as some other PCL projects. I have several custom build configurations set up for the iOS and Android projects.

If I try to build any of these custom configurations from the command line:

msbuild App.Android.csproj /p:Configuration=Foo /t:SignAndroidPackage

I (expectedly) get an error about the missing configurations:

The OutputPath property is not set for project 'PCL.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Foo' Platform='AnyCPU'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.

For iOS, I'm able to simply create configuration mappings in the solution and build the solution instead of the project.

However, with Android, it's not that simple and I've been banging my head against the wall for hours trying to figure it out. The problem is that I can't specify the SignAndroidPackage target when building the solution, since that target only exists in the Android project.

I would really rather not add the missing configurations to the projects that don't require them. I know, I'm OCD. :)

If anyone has any suggestions or workarounds, I will be forever grateful.



Sign In or Register to comment.