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 on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 11209 [details]
Manifests and build outputs
*** Overview ***
Setting the Minimum Android to Target option to "Use Compile using SDK" does not result in android:minSdkVersion being set to the right API level in the manifest file. Instead it sets android:minSdkVersion="11" regardless of what the actual API level is used to compile. This occurs in both debug and release configurations.
Changing the option to a specific API level behaves correctly and android:minSdkVersion is set to the selected API level.
Regression Status: Xamarin 3.9.547 does _not_ experience this issue.
I've attached two AndroidManifest.xml files showing the difference and the build output for each build.
*** Steps to Reproduce ***
1. Create a new Android project or open an existing project
2. Right click the Android project and go to "Properties > Application"
3. Set Minimum Android to Target to "Use Compile using SDK"
4. Rebuild the project so it is cleaned and rebuilt
5. Go to [project location]\obj\Debug\android\
6. Open "AndroidManifest.xml" and note that android:minSdkVersion="11"
7. Right click the Android project and go to "Properties > Application"
8. Set Minimum Android to Target to a specific API level
9. Rebuild the project
10. Go to [project location]\obj\Debug\android\
11. Open "AndroidManifest.xml" and note that android:minSdkVersion is set to selected API level
*** Actual Results ***
"Use Compile using SDK" ignores the compiling SDK version and defaults to setting android:minSdkVersion="11"
*** Expected Results ***
"Use Compile using SDK" sets android:minSdkVersion to the SDK version used to compile
*** Environment Info ***
Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Installed Version: Professional
Team Explorer for Visual Studio 2013 06177-004-0444002-02323
Microsoft Team Explorer for Visual Studio 2013
Visual Basic 2013 06177-004-0444002-02323
Microsoft Visual Basic 2013
Visual C# 2013 06177-004-0444002-02323
Microsoft Visual C# 2013
Visual C++ 2013 06177-004-0444002-02323
Microsoft Visual C++ 2013
Visual F# 2013 06177-004-0444002-02323
Microsoft Visual F# 2013
Visual Studio 2013 Code Analysis Spell Checker 06177-004-0444002-02323
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker
Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.
The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.
Windows Phone SDK 8.0 - ENU 06177-004-0444002-02323
Windows Phone SDK 8.0 - ENU
Application Insights Tools for Visual Studio Package 1.0
Application Insights Tools for Visual Studio
Common Azure Tools 1.3
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Microsoft Advertising SDK for Windows Phone
Microsoft Advertising SDK for Windows Phone
Microsoft Azure Mobile Services Tools 1.3
Microsoft Azure Mobile Services Tools
Multilingual App Toolkit 3.1.1250.0
Multilingual App Toolkit helps you localize your Windows Store app by providing file management, pseudo and machine translation, translation editor, and build integration. http://go.microsoft.com/fwlink?linkid=245767
NuGet Package Manager 2.8.50926.663
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
PowerShell Tools 1.3
Provides file classification services using PowerShell
PreEmptive Analytics Visualizer 1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.
Windows Phone 8.1 SDK Integration 1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.
Xamarin 3.11.558.0 (0f136e1)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin.Android 184.108.40.206 (cb23915ae0ecb65f7bb956231fae0e234f66223e)
Visual Studio plugin to enable development for Xamarin.Android.
Xamarin.Forms Intellisense 1.0
Provides intellisense for Xamarin.Forms in the XML editor.
Xamarin.iOS 220.127.116.11 (4ef5acddd229f2115678f0886b173075eeb8350e)
Visual Studio extension to enable development for Xamarin.iOS.
Xamarin.iOS Unified Migration 1.0
Automated migration for Xamarin iOS Classic projects to Unified
Early preview of Xamarin Test Cloud integration
I have tried this issue and able to reproduce this issue with the following build:
To verify this issue I have checked this issue with latest C7 build:
Observing the same reported behavior at my end. I have followed the steps given in the bug description. After setting Minimum Android to Target to "Use Compile using SDK". It will set the default android:minSdkVersion="11".
Android Manifest: https://gist.github.com/Abhishekk360/98a77c848c7c96b047c1743531a25e5c
Build Output: https://gist.github.com/Abhishekk360/df75e273070884e59919d42bcb8a3816
Hence reopening this issue. Let me know If I can provide any other details.
I have checked this issue with latest C7 build on Windows and Mac XS and I am observing that after selecting minimum Android Version: Automatic-Use target framework version (API23) and build the application. Go to [project location]\obj\Debug\android\ and Open "AndroidManifest.xml" and observe android:minSdkVersion="11".
Build Output: https://gist.github.com/Abhishekk360/ea1b4b3b9fb9233315c43c435027fd52
Build Output: https://gist.github.com/Abhishekk360/92dca90f742f4d3296db8f13cf998739
Just let me know if I can provide and other details.
This is By Design and documented:
If Properties\AndroidManifest.xml doesn't specify a //uses-sdk/@android:minSdkVersion value, then the behavior before Xamarin.Android 5.1 was to use the Android SDK version, which was usually the $(TargetFrameworkVersion).
This as changed with Xamarin.Android 5.1 to be "11" when $(TargetFrameworkVersion) was >= API-11, because it was extremely annoying otherwise.
Pre-5.1, if you had an Android API preview SDK installed on the development machine *but not the target device*, building the default project would result in an app which couldn't be deployed to the target device. This was easily fixed by overriding the minSdkVersion value, but the need to almost always do that was annoying.