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 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 9053 [details]
Incompatible API Level
I've created a F# Android application using Xamarin for Visual Studio 3.9.142, the project builds normally as expected but when runs it always shows the error: "Minimum Android version not supported by device".
My device is a JellyBean Android (4.1.2 - API 16).
My application properties:
- Compile using Android API Level 21
- Minimum Android to target is API Level 15
- Target Android version is "Use Compile using SDK version".
It works very well in an C# Xamarin.Android application, it builds and runs very nice :D but in a F# Xamarin.Android application not :'(.
Please see the photo attached, there is some sort of overlap of the application settings during the build process, the minimum Android to target is API Level 15 in project properties but the dialog shows minimum API Level 19.
Using command-line: aapt list -a [name].apk. I can see that Xamarin.Android simple ignored the minSdkVersion that was API Level 15 and setted it to API Level 19 in generated apk. The minimum Android to target always will be the same that "Compile API Level".
Project Properties -> Android Options -> Always show "Null object cannot be converted to a value type". Unlike common.
Android SDK Settings:
SDK Tools 24.0.1
Visual Studio Settings:
Microsoft Visual Studio Ultimate 2015 Preview
Version 14.0.22310.1 DP
Microsoft .NET Framework
Installed Version: Ultimate
Architecture and Modeling Tools 00269-30000-00001-AA175
Microsoft Architecture and Modeling Tools
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.
Visual Basic 2015 Preview 00269-30000-00001-AA175
Microsoft Visual Basic 2015 Preview
Visual C# 2015 Preview 00269-30000-00001-AA175
Microsoft Visual C# 2015 Preview
Visual C++ 2015 Preview 00269-30000-00001-AA175
Microsoft Visual C++ 2015 Preview
Visual F# 2015 Preview 00269-30000-00001-AA175
Microsoft Visual F# 2015 Preview
Visual Studio 2015 Preview Code Analysis Spell Checker 00269-30000-00001-AA175
Microsoft® Visual Studio® 2015 Preview 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 00269-30000-00001-AA175
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.
Information about my package
JetBrains ReSharper Platform 6 Build 6.0.20141204.190160 on 2014-12-04 19:29:31Z
JetBrains ReSharper Platform package for Microsoft Visual Studio. For more information about ReSharper Platform, visit http://www.jetbrains.com/resharper. Copyright © 2014 JetBrains, Inc.
Microsoft Azure Mobile Services Tools 1.3
Microsoft Azure Mobile Services Tools
Microsoft Code Digger 0.9
Microsoft Code Digger
NuGet Package Manager 3.0.51103.210
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
SQL Server Data Tools 14.0.41025.0
Microsoft SQL Server Data Tools
Xamarin 220.127.116.11 (e7bacad)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin.Android 18.104.22.168 (49a04b966feb40dfdba49d57ba16249b66d606a6)
Visual Studio plugin to enable development for Xamarin.Android.
Xamarin.iOS 22.214.171.124 (22574c9788a6d607f8d119e4d645f5ce5a346553)
Visual Studio extension to enable development for Xamarin.iOS.
Please attach a project and/or the .fsproj file and diagnostic build output.
This same thing has happened to me just now. Please see the attached zip containing:
* The F# Visual Studio 2015 solution and project, which is the unmodified template that you get by selecting New Project -> Visual F# -> Blank App (Android).
* The diagnostic build output from having a clean project and then selecting Build -> Deploy Solution, with a default AVD emulator image targeted, at API 15.
* The output from running "aapt list -a <APK>" on the signed apk file under bin/Debug. This shows that the apk has minSdkVersion = 0x17 (23) and not 0x0F (15) as expected.
* The version info from Visual Studio About window.
In short, it seems that even though the manifest has <uses-sdk android:minSdkVersion="15" /> set, the resulting apk gets the same minSdkVersion as the "buildUsing" version of the SDK, which is 23.
Created attachment 15850 [details]
Reproducing project and log files from build
In the build output I found the following:
2>Target "_ValidateAndroidPackageProperties" in file "[...]\Xamarin.Android.Common.targets" from project "[...]\AndroidMinSdkVersionBug.fsproj" (target "_UpdateAndroidResgen" depends on it):
2>Task "CreateProperty" skipped, due to false condition; ('$(AndroidManifest)' != '') was evaluated as ('' != '').
It seems that the fsproj file is missing the AndroidManifest property, which in present in the C# version of the same template project. The problem seems to be solved if I manually add
to the end of the first PropertyGroup in the fsproj file.
So it seems this is more of a bug in the project template than in the build scripts.
The following templates are affected:
* Blank App (Android)
* OpenGL App (Android)
These are not affected:
* Unit Test App (Android)
* Class Library (Android) (since it does not have a manifest file)
Switching back to NEW as the info was provided.
Changing the Target Milestone for visibility.
As we've introduced several improvements around this area, I'll mark the bug as resolved fixed.
Please feel free to reopen it if you can still reproduce the issue with current bits.