Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 19556 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
My goal is to add a Conditional statement to the csproj file such that when the Build configuration is set to Debug, my Android app will use Properties\AndroidManifestDebug.xml as the manifest template, and use Properties\AndroidManifestDebug.xml for all other Build configurations.
More specifically, I want to define separate manifest templates for Build configurations so that I can build and deploy versions of the same app with different package names side-by-side:
The behavior that I expect is that when I redefine the AndroidManifest property, that the build process will use the redefined AndroidManifest file to build the application package.
The behavior that I see is that when I redefine the AndroidManifest inside of the existing Debug conditional PropertyGroup and attempt to deploy a Debug build, the application deployment fails:
Deployment failed because of an internal error: Could not find file "/repro/ConditionalManifest/bin/Debug/com.example.conditionalmanifest-Signed.apk".
Deployment failed. Internal error.
Created attachment 6741 [details]
I have checked this issue and I am able to reproduce this issue.
Steps to reproduce :
1. Open the attached project on XS
2. Debug the project
3. Deployment error will occur
I observe that when I deploy attached project on "Debug" mode, I am also getting deployment error but With a little work around here, I have found that there is wrong package name mentioned on "AndroidManifestDebug.xml" file i.e. "com.example.conditionalmanifest.debug". When I change this package name to this "com.example.conditionalmanifest" then I am able to deploy application successfully on both mode ( Debug/Release).
Please check the same on your end and let us know if this is working fine for you now.
Thanks for following up, Ram.
My intention is that I *want* to have 2 different package names so that both the "Debug" and "Release" build configurations can be installed onto the device side-by-side at the same time. So, changing the package name isn't really an option. I need to be able to specify unique package names for N-build configurations within a single android project.
The apk is *building* just fine with the conditionally included manifest.
The issue here is that the manifest changes the package name, and XS need to know the package name to find the apk file and deploy it. Due to limitations in the XS MSBuild integration, the execution engine cannot evaluate arbitrary MSBuild properties, so it's just reading the project-level manifest.
For more info see http://mjhutchinson.com/journal/2012/08/19/state_msbuild_support_monodevelop, which is still mostly true.
So you can *build* different configurations with different package names, but from the IDE you can currently only execute the ones that use the root manifest.
Fixing this will depend on better integrating MSBuild engine into the core project system.
I think I understand, now. You're suggesting that the build and output of the project is just fine. If I were to execute the build via some script or msbuild command outside of XS, I would "net" the result that I'm looking for. You're just saying that I won't see that result I'm expecting when attempting to build and deploy from the IDE.
Does that sum it up accurately?
XS will create the actual apk, it just won't be able to upload it to the device and execute it.
The build is split into two parts, building and packaging. XS automatically runs the packaging step before uploading the app. Although the upload will fail, the packaging step will succeed, and you'll be able to find the apk in the build directory.
Of course, not the answer I really wanted to hear, but I understand that the nuances of getting 100% MS Build integration into XS is not an easy thing, and that there are higher priorities. Again, thanks for taking the time to explain how everything is working instead of simply saying, "Won't work. Next."
*** Bug 44133 has been marked as a duplicate of this bug. ***