Skip to content

Conversation

@jonathanpeppers
Copy link
Member

Context: 95f4b79

When making API 34 the default in .NET 8, some tests tried to build net7.0-android projects with an AndroidManifest.xml that contains:

<uses-sdk android:targetSdkVersion="34" />

This won't work until we backport API 34 to .NET 7.

In general, you shouldn't use <uses-sdk/> in .NET 6+ apps as the following MSBuild properties should be used instead:

<TargetFramework>net7.0-android33</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>

Where 33 is implicit if left out.

Let's no longer set TargetSdkVersion by default in our MSBuild tests, as this is closer to what customers will do. We also no longer build or test Xamarin.Android in main.

I removed places in tests that set TargetSdkVersion = null and removed one test that is no longer valid in main/.NET 6+.

Context: dotnet@95f4b79

When making API 34 the default in .NET 8, some tests tried to build
`net7.0-android` projects with an `AndroidManifest.xml` that contains:

    <uses-sdk android:targetSdkVersion="34" />

This won't work until we backport API 34 to .NET 7.

In general, you shouldn't use `<uses-sdk/>` in .NET 6+ apps as the
following MSBuild properties should be used instead:

    <TargetFramework>net7.0-android33</TargetFramework>
    <SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>

Where `33` is implicit if left out.

Let's no longer set `TargetSdkVersion` by default in our MSBuild tests,
as this is closer to what customers will do. We also no longer build or
test Xamarin.Android in main.

I removed places in tests that set `TargetSdkVersion = null` and removed
one test that is no longer valid in main/.NET 6+.
@jonathanpeppers jonathanpeppers marked this pull request as ready for review June 22, 2023 14:35
@dellis1972 dellis1972 merged commit 2b1ec45 into dotnet:main Jun 22, 2023
@jonathanpeppers jonathanpeppers deleted the TargetSdkVersion branch June 22, 2023 18:11
grendello added a commit to grendello/xamarin-android that referenced this pull request Jun 23, 2023
* main:
  Bump to google/bundletool@f17ce94a (dotnet#8135)
  [Xamarin.Android.Build.Tasks] Handle IOException in Aapt2Daemon (dotnet#8130)
  [tests] don't set `/uses-sdk@android:targetSdkVersion=34` by default (dotnet#8138)
grendello added a commit to grendello/xamarin-android that referenced this pull request Jun 26, 2023
* main:
  Bump to google/bundletool@f17ce94a (dotnet#8135)
  [Xamarin.Android.Build.Tasks] Handle IOException in Aapt2Daemon (dotnet#8130)
  [tests] don't set `/uses-sdk@android:targetSdkVersion=34` by default (dotnet#8138)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants