Appcenter: Build Xamarin.Android from solution

Created on 8 Aug 2019  路  15Comments  路  Source: microsoft/appcenter

Describe the solution you'd like
Add a way to build a Xamarin.Android app from the *.sln

Describe alternatives you've considered
A less than ideal workaround is to make sure the same configuration is present in all the referenced projects unfortunately it is not always convenient.

Additional context
Currently a build might fail if all the projects referenced by the csproj do not have the same configuration. In a solution, it is possible to have different configurations for each referenced projects.

This works on iOS, are there any technical reason it is not available on Android as well?

build feature request reviewed-DRI

All 15 comments

Thanks @prollin for the response, @nrajpurkar would you mind taking a look?

I almost created the exact same issue just now, this is kind of a problem for me. I have a Xamarin.Android app with quite some build configurations that change up some names and logos. It references some library projects that really only have a "Debug" and "Release" configuration. The configuration manager on the solution level is used to determine which of these two builds for any of the other configurations. This builds fine in Visual Studio and in our custom CLI build script. In App Center Build though, the solution configuration is ignored which results in the error:

The OutputPath property is not set for project 'MyAppHere'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='ReleaseCustom'  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.

In our custom script we specify the solution as the project argument to msbuild and "ProjectName:TargetName" as the target to make it work:

msbuild Solution.sln /p:Configuration="ReleaseCustom" /t:"MyAppHere:SignAndroidPackage"

Indeed a workaround would be to make sure that all configurations exist for all library projects, but this gets ugly and unmaintainable fast.

Don't know if I consider this a missing feature or a bug - as mentioned it builds just fine in VS so you'd expect it to do the same in Build.

@amchew @nrajpurkar any update on this issue?

Unless I am missing an obvious workaround, this is an important feature for anyone working on a real world project with external dependencies.

Is there any issue specific to Android that prevent this from being an easy fix?

@amchew @nrajpurkar Sorry to bump this up but this is still an issue and no simple workaround has been provided.

Unless I am missing something, It is currently not possible to build an Android solution through App Center. It works for simple demo projects but any solution containing multiple project all set to different configurations do not work.

This should be labelled as a bug, not a feature.

For me, appcenter is not useable for building android projects because of this limitation. My Solution has more than 20 projects because of some platform specific plugins. I also have more than 15 different configurations (Debug, Staging, App-Store, and each for different countries). It is not manageable to add each configuration to the csproj-file. And this feature is available for IOS builds.

@amchew any update on this? Nobody else uses AppCenter to build large Android projects?

@prollin I personally did some csproj hacking to make sure each build configuration does something sensible for each project... It's really ugly, but less work than building manually each time. I still hope this will be resolved of course.

@ElteHupkes modifying each csproj is of course an option but it becomes annoying when those other projects are updated. I just would love to understand why this is an issue on Android; is there some weird behavior in the way Xamarin.Android interacts with msbuild that makes this feature complex to implement?

@prollin I agree, it's a pain. I guess there just aren't enough people upvoting for it to get priority.

I also have this problem and am tired of the ugly hacks needed to make for example compile time constants work when building for android

+1

@elamalani, still no official news? Will it be fixed or is the effected number of users too low?

Such feature would be quite welcomed.

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

So, should I just add some "further activity" in the form of a comment so the bot knows we're still interested? Rhetorical question.

Was this page helpful?
0 / 5 - 0 ratings