Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MinSdkVersion being replaced by the targetSdkVersion in the output of AndroidManifest.xml #2794

eduardo-rta opened this Issue Mar 5, 2019 · 4 comments


None yet
3 participants
Copy link

commented Mar 5, 2019

Steps to Reproduce

  1. Just created a brand new solution with Android (Native)
  2. Added another android application to the same solution.
  3. The second one will not run (Sometimes not even the first one)

Tested with Beta/Stable version

Expected Behavior

Set MinSdkTarget target to a value and the output AndroidManifest.Xml should keep this value

Actual Behavior

MinSdkTarget is being replaced by whatever I have in the Target version

Version Information

Visual Studio Community 2017 for Mac
Version 7.8.2 (build 1)
Installation UUID: 03888467-08f3-4c90-8c92-6e56438625df
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac ( / b40230c0)

Package version: 516000221

Mono Framework MDK
Mono (2018-06/b63e5378e38) (64-bit)
Package version: 516000221


.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
SDK: /usr/local/share/dotnet/sdk/2.1.504/Sdks
SDK Versions:
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Sdks

Version: 1.6.4
Location: /Applications/Xamarin Profiler

Version: 11

Apple Developer Tools
Xcode 10.1 (14460.46)
Build 10B61

Version: (Visual Studio Community)
Hash: d60abd198
Build date: 2019-02-01 12:23:30-0500

Version: (Visual Studio Community)
Hash: d60abd198
Branch: d15-9
Build date: 2019-02-01 12:23:29-0500

Version: (Visual Studio Community)
Android SDK: /Users/eduardoappolinario/Library/Android/sdk
Supported Android versions:
4.3 (API level 18)
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.1
SDK Build Tools Version: 28.0.3

Microsoft Mobile OpenJDK
Java SDK: /Users/eduardoappolinario/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
Android Designer EPL code available here:

Android Device Manager
Hash: 8924ea4a

Xamarin Inspector
Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

Build Information
Release ID: 708020001
Git revision: 13e0e5b7e85ffe742957e6f204bab5c06c644f0e
Build date: 2019-02-27 19:33:14+00
Build branch: release-7.8
Xamarin extensions: 23eaa7c9cdc9a3f55be7bb87b485a790ec82ef25

Operating System
Mac OS X 10.14.3
Darwin 18.2.0 Darwin Kernel Version 18.2.0
Thu Dec 20 20:46:53 PST 2018
root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64

Log File


This comment has been minimized.

Copy link

commented Mar 7, 2019

@eduardo-rta could you help provide some more information around what exact scenarios are not working for you?

To the first point of your minSdkVersion changing on you -- what value are you attempting to use? I am unable to reproduce this issue. I tried a few cases (minSdkVersion=10 + targetSdkVersion=26, minSdkVersion=21 + targetSdkVersion=28) and in these cases the content of obj/Debug/android/AndroidManifest.xml contained the minSdkVersion value I was expecting after building the project.

To your second point -- what do you mean by 'will not run'? Are you encountering a build error? Or are you unable to deploy to a device/emulator? Are you encountering a crash once the Android app is running?


This comment has been minimized.

Copy link

commented Mar 14, 2019

I hit this issue today as well. It was only when I added a Xamarin.Android project to an existing solution that only had a Mono console project in it. If I created a new Xamarin.Android solution then it worked as expected.


This comment has been minimized.

Copy link

commented Mar 14, 2019

I could make it happen again:


  • New Project
    -.NET Core -> Library -> .NET Standard Library (.NET Standard 2.0)
    -Add new Project to Solution
    -Android -> App -> Android App (Modern Development, Theme: Default) - created with automated UI Test
    -Android App Options -> Build -> Android Application (Select target 9.0)
    -Android App Options -> Build -> General -> Compile using (9.0)

When you try to run to an emulator that has version < 9.0 it says the Sdk is Wrong.

If you open the original manifest you will see the minSdk has the right information, but in the output manifest the minSdk is the same as the Compile version (9.0)

@pjcollins pjcollins removed the need-info label Mar 18, 2019

@pjcollins pjcollins modified the milestones: Under Consideration, d16-1 Mar 18, 2019


This comment has been minimized.

Copy link

commented Mar 18, 2019

Thanks for the updated instructions, I've managed to reproduce this with d15-9 and d16-0 builds of XA.

I've attached a repro with a binlog and diagnostic build output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.