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.
I wanted to create an app that would take advantage of API level 11, but still run in a reduced functionality mode down to API level 8.
In my projects settings, I set "Application/Minimum Android to Target" to "Android 2.2" and "Android Manifest/Target API level" to 12 (closest available to 11). My application wouldn't compile since it was taking advantage of API level 11. If I set "Application/Minimum Android to Target" to "Android 3.1", it would compile but wouldn't run on an Android 2.2 machine.
I was able to solve my problem by manually editing AndroidManifest.xml and adding android:minSdkVersion="8" to the uses-sdk attribute. That allowed be to compile (I had Minimum Android to Target set to 3.1), and since I guarded the API 11 section of my code it would run on a 2.2 machine.
If I understand the setting correctly, "Minimum Android to Target" should have set minSdkLevel automatically, and "Target API level" should have adjusted the compile-time API level.
This is a terminology bug and missing feature: Visual Studio doesn't provide a way to set the AndroidManifest.xml //uses-sdk/@android:minSdkVersion attribute. We should add that.
*** This bug has been marked as a duplicate of bug 10978 ***