Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

Commit ce7ea04

Browse files
authored
Update to net8.0-android. (#877)
Switch from using `net7.0-android` to `net8.0-android`. Reworks our `BuildAll*` test suites to actually add the packages to the projects, which results in various errors, predominantly around duplicate managed or Java types. These errors are expected, as there are various packages that aren't intended to be used simultaneously, like `Xamarin.GooglePlayServices.Games` and `Xamarin.GooglePlayServices.Games.V2`. Remove these problematic packages using `<PackageReference Remove... />`. The remaining packages are tested as expected.
1 parent 432d7cc commit ce7ea04

27 files changed

+189
-220
lines changed

Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<RepositoryType>git</RepositoryType>
55

66
<!-- Default TFM's we build for -->
7-
<_DefaultTargetFrameworks>net7.0-android</_DefaultTargetFrameworks>
7+
<_DefaultTargetFrameworks>net8.0-android</_DefaultTargetFrameworks>
88

99
<!-- Use an updated 'generator' -->
1010
<!-- It's ok to use "Windows" here because we only use managed code from this package -->
@@ -35,11 +35,11 @@
3535

3636
<!-- Folders that various files get placed into -->
3737
<ItemGroup>
38-
<_TargetFrameworkNugetBuildFolders Include="build\net7.0-android33.0" />
39-
<_TargetFrameworkNugetBuildFolders Include="buildTransitive\net7.0-android33.0" />
38+
<_TargetFrameworkNugetBuildFolders Include="build\net8.0-android34.0" />
39+
<_TargetFrameworkNugetBuildFolders Include="buildTransitive\net8.0-android34.0" />
4040
</ItemGroup>
4141

4242
<ItemGroup>
43-
<_TargetFrameworkNugetAarFolders Include="aar\net7.0-android33.0" />
43+
<_TargetFrameworkNugetAarFolders Include="aar\net8.0-android34.0" />
4444
</ItemGroup>
4545
</Project>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"sdk":
33
{
4-
"version": "7.0.408",
4+
"version": "8.0.301",
55
"rollForward": "patch"
66
},
77
"msbuild-sdks":

published-namespaces.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ Javax.Annotation.Concurrent
501501
Javax.Annotation.Meta
502502
JavaX.Inject
503503
JWT
504-
Microsoft.CodeAnalysis
505504
Retrofit2.Internal
506505
Square.JavaPoet
507506
Square.OkHttp
@@ -524,7 +523,6 @@ Square.Retrofit2.Adapter.RxJava2
524523
Square.Retrofit2.Converter.Gson
525524
Square.Retrofit2.Converter.Scalars
526525
Square.Retrofit2.Http
527-
System.Runtime.CompilerServices
528526
Volley
529527
Volley.CroNet
530528
Volley.Toolbox

samples/Directory.Build.props

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
<Project>
22

3-
<!-- Default TFM's we build for -->
43
<PropertyGroup>
5-
<_DefaultDotNetSampleTargetFrameworks>net7.0-android</_DefaultDotNetSampleTargetFrameworks>
4+
<!-- Default TFM's we build for -->
5+
<_DefaultDotNetSampleTargetFrameworks>net8.0-android</_DefaultDotNetSampleTargetFrameworks>
6+
7+
<!-- Package downgrade detected -->
8+
<NoWarn>$(NoWarn);NU1605</NoWarn>
9+
10+
<!-- Locations for PackageReferences -->
11+
<PackagesGPS>$(MSBuildThisFileDirectory)../output/PlayServicesPackages.targets</PackagesGPS>
12+
<PackagesFB>$(MSBuildThisFileDirectory)../output/FirebasePackages.targets</PackagesFB>
13+
<PackagesMLKit>$(MSBuildThisFileDirectory)../output/Google.MLKit.targets</PackagesMLKit>
14+
<PackagesGP>$(MSBuildThisFileDirectory)../output/Google.Play.targets</PackagesGP>
615
</PropertyGroup>
716

817
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,61 @@
33
<PropertyGroup>
44
<TargetFrameworks>$(_DefaultDotNetSampleTargetFrameworks)</TargetFrameworks>
55

6-
<!-- Some packages specify a minimum of 28 (eg: Xamarin.AndroidX.HeifWriter) -->
7-
<!--
8-
<SupportedOSPlatformVersion>28</SupportedOSPlatformVersion>
6+
<SupportedOSPlatformVersion>29</SupportedOSPlatformVersion>
97
<OutputType>Exe</OutputType>
108
<Nullable>enable</Nullable>
119
<ImplicitUsings>enable</ImplicitUsings>
1210
<ApplicationId>com.companyname.BuildAllDotNet</ApplicationId>
1311
<ApplicationVersion>1</ApplicationVersion>
14-
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
15-
-->
12+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
13+
</PropertyGroup>
1614

17-
18-
<!-- Override property from 'Directory.Build.props' -->
19-
<!--
20-
<AndroidGenerateResourceDesigner>true</AndroidGenerateResourceDesigner>
21-
-->
22-
23-
<!-- Prevent linking, since that would remove ~everything -->
24-
<!--
25-
<PublishTrimmed>False</PublishTrimmed>
26-
<RunAOTCompilation>False</RunAOTCompilation>
27-
-->
28-
29-
</PropertyGroup>
30-
31-
<Import
32-
Project="..\..\..\output\Directory.GPS.packages.props"
33-
/>
34-
<Import
35-
Project="..\..\..\output\Directory.FB.packages.props"
36-
/>
37-
<Import
38-
Project="..\..\..\output\Directory.MLKit.packages.props"
39-
/>
40-
<Import
41-
Project="..\..\..\output\Directory.GP.packages.props"
42-
/>
43-
<Import
44-
Project="..\..\..\output\Directory.Diverse.packages.props"
45-
/>
15+
<Import Project="$(PackagesGPS)" />
16+
<Import Project="$(PackagesFB)" />
17+
<Import Project="$(PackagesMLKit)" />
18+
<Import Project="$(PackagesGP)" />
19+
20+
<ItemGroup>
21+
<!-- PlayServicePackages.targets -->
22+
<!-- Duplicate managed types (due to Games.V2) -->
23+
<PackageReference Remove="Xamarin.GooglePlayServices.Games" />
24+
25+
<!-- Duplicate Java types -->
26+
<PackageReference Remove="Xamarin.GooglePlayServices.Ads.Base" />
27+
<PackageReference Remove="Xamarin.GooglePlayServices.Ads.Lite" />
28+
<PackageReference Remove="Xamarin.GooglePlayServices.Gass" />
29+
<PackageReference Remove="Xamarin.GooglePlayServices.Measurement.Base" />
30+
31+
<!-- FirebasePackages.targets -->
32+
<!-- Duplicate Java types -->
33+
<PackageReference Remove="Xamarin.Firebase.Analytics" />
34+
<PackageReference Remove="Xamarin.Firebase.Analytics.Impl" />
35+
<PackageReference Remove="Xamarin.Firebase.Analytics.Ktx" />
36+
<PackageReference Remove="Xamarin.Firebase.AppIndexing" />
37+
<PackageReference Remove="Xamarin.Firebase.ML.Vision" />
38+
<PackageReference Remove="Xamarin.Firebase.ML.Vision.AutoML" />
39+
<PackageReference Remove="Xamarin.Firebase.ML.Vision.BarCode.Model" />
40+
<PackageReference Remove="Xamarin.Firebase.ML.Vision.Face.Model" />
41+
<PackageReference Remove="Xamarin.Firebase.ML.Vision.Image.Label.Model" />
42+
<PackageReference Remove="Xamarin.Firebase.ML.Vision.Internal.Vkp" />
43+
<PackageReference Remove="Xamarin.Firebase.ML.Vision.Object.Detection.Model" />
44+
45+
<!-- Google.MLKit.targets -->
46+
<!-- Duplicate Java types -->
47+
<PackageReference Remove="Xamarin.Google.MLKit.FaceDetection" />
48+
49+
<!-- Google.Play.targets -->
50+
<!-- Split into separate packages, these older ones cause duplicate bound types -->
51+
<PackageReference Remove="Xamarin.Google.Android.Play.Core" />
52+
<PackageReference Remove="Xamarin.Google.Android.Play.Core.Common" />
53+
<PackageReference Remove="Xamarin.Google.Android.Play.Core.Ktx" />
54+
55+
<!-- Causes Kotlin.Stdlib version conflicts -->
56+
<PackageReference Remove="Xamarin.Google.Android.Play.App.Update.Ktx" />
57+
<PackageReference Remove="Xamarin.Google.Android.Play.Asset.Delivery.Ktx" />
58+
<PackageReference Remove="Xamarin.Google.Android.Play.Core.Ktx" />
59+
<PackageReference Remove="Xamarin.Google.Android.Play.Feature.Delivery.Ktx" />
60+
<PackageReference Remove="Xamarin.Google.Android.Play.Review.Ktx" />
61+
</ItemGroup>
4662

4763
</Project>

samples/dotnet/BuildAllFbDotNet/BuildAllFbDotNet.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
</PropertyGroup>
1616

17-
<Import
18-
Project="..\..\..\output\Directory.FB.packages.props"
19-
/>
17+
<Import Project="$(PackagesFB)" />
2018

2119
</Project>

samples/dotnet/BuildAllFbDotNet/Directory.Build.targets

Lines changed: 0 additions & 3 deletions
This file was deleted.

samples/dotnet/BuildAllGpsDotNet/BuildAllGpsDotNet.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
</PropertyGroup>
1616

17-
<Import
18-
Project="..\..\..\output\Directory.GPS.packages.props"
19-
/>
17+
<Import Project="$(PackagesGPS)" />
2018

2119
</Project>

samples/dotnet/BuildAllGpsDotNet/Directory.Build.targets

Lines changed: 0 additions & 3 deletions
This file was deleted.

samples/dotnet/BuildAllMLKitDotNet/BuildAllMLKitDotNet.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
</PropertyGroup>
1616

17-
<Import
18-
Project="..\..\..\output\Directory.MLKit.packages.props"
19-
/>
17+
<Import Project="$(PackagesMLKit)" />
2018

2119
</Project>

samples/dotnet/BuildAllMLKitDotNet/Directory.Build.targets

Lines changed: 0 additions & 3 deletions
This file was deleted.

samples/dotnet/BuildAllMauiApp/BuildAllMauiApp.csproj

Lines changed: 51 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<TargetFrameworks>$(_DefaultDotNetSampleTargetFrameworks)</TargetFrameworks>
55
<OutputType>Exe</OutputType>
66
<RootNamespace>BuildAllMauiApp</RootNamespace>
7-
<UseMaui>true</UseMaui>
87
<SingleProject>true</SingleProject>
98
<ImplicitUsings>enable</ImplicitUsings>
109

@@ -21,13 +20,15 @@
2120

2221
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
2322
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
24-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
23+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">29.0</SupportedOSPlatformVersion>
2524
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
2625
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
2726
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
2827
</PropertyGroup>
2928

3029
<ItemGroup>
30+
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.21" />
31+
3132
<!-- App Icon -->
3233
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
3334

@@ -45,27 +46,54 @@
4546
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
4647
</ItemGroup>
4748

48-
<Import
49-
Condition="$(TargetFramework.StartsWith('$(_DefaultDotNetSampleTargetFrameworks)')) == true"
50-
Project="..\..\..\output\Directory.GPS.packages.props"
51-
/>
52-
<Import
53-
Condition="$(TargetFramework.StartsWith('$(_DefaultDotNetSampleTargetFrameworks)')) == true"
54-
Project="..\..\..\output\Directory.FB.packages.props"
55-
/>
56-
<Import
57-
Condition="$(TargetFramework.StartsWith('$(_DefaultDotNetSampleTargetFrameworks)')) == true"
58-
Project="..\..\..\output\Directory.MLKit.packages.props"
59-
/>
60-
<Import
61-
Condition="$(TargetFramework.StartsWith('$(_DefaultDotNetSampleTargetFrameworks)')) == true"
62-
Project="..\..\..\output\Directory.GP.packages.props"
63-
/>
64-
<Import
65-
Condition="$(TargetFramework.StartsWith('$(_DefaultDotNetSampleTargetFrameworks)')) == true"
66-
Project="..\..\..\output\Directory.Diverse.packages.props"
67-
/>
68-
49+
<Import Project="$(PackagesGPS)" />
50+
<Import Project="$(PackagesFB)" />
51+
<Import Project="$(PackagesMLKit)" />
52+
<Import Project="$(PackagesGP)" />
53+
54+
<ItemGroup>
55+
<!-- PlayServicePackages.targets -->
56+
<!-- Duplicate managed types (due to Games.V2) -->
57+
<PackageReference Remove="Xamarin.GooglePlayServices.Games" />
58+
59+
<!-- Duplicate Java types -->
60+
<PackageReference Remove="Xamarin.GooglePlayServices.Ads.Base" />
61+
<PackageReference Remove="Xamarin.GooglePlayServices.Ads.Lite" />
62+
<PackageReference Remove="Xamarin.GooglePlayServices.Gass" />
63+
<PackageReference Remove="Xamarin.GooglePlayServices.Measurement.Base" />
64+
65+
<!-- FirebasePackages.targets -->
66+
<!-- Duplicate Java types -->
67+
<PackageReference Remove="Xamarin.Firebase.Analytics" />
68+
<PackageReference Remove="Xamarin.Firebase.Analytics.Impl" />
69+
<PackageReference Remove="Xamarin.Firebase.Analytics.Ktx" />
70+
<PackageReference Remove="Xamarin.Firebase.AppIndexing" />
71+
<PackageReference Remove="Xamarin.Firebase.ML.Vision" />
72+
<PackageReference Remove="Xamarin.Firebase.ML.Vision.AutoML" />
73+
<PackageReference Remove="Xamarin.Firebase.ML.Vision.BarCode.Model" />
74+
<PackageReference Remove="Xamarin.Firebase.ML.Vision.Face.Model" />
75+
<PackageReference Remove="Xamarin.Firebase.ML.Vision.Image.Label.Model" />
76+
<PackageReference Remove="Xamarin.Firebase.ML.Vision.Internal.Vkp" />
77+
<PackageReference Remove="Xamarin.Firebase.ML.Vision.Object.Detection.Model" />
78+
79+
<!-- Google.MLKit.targets -->
80+
<!-- Duplicate Java types -->
81+
<PackageReference Remove="Xamarin.Google.MLKit.FaceDetection" />
82+
83+
<!-- Google.Play.targets -->
84+
<!-- Split into separate packages, these older ones cause duplicate bound types -->
85+
<PackageReference Remove="Xamarin.Google.Android.Play.Core" />
86+
<PackageReference Remove="Xamarin.Google.Android.Play.Core.Common" />
87+
<PackageReference Remove="Xamarin.Google.Android.Play.Core.Ktx" />
88+
89+
<!-- Causes Kotlin.Stdlib version conflicts -->
90+
<PackageReference Remove="Xamarin.Google.Android.Play.App.Update.Ktx" />
91+
<PackageReference Remove="Xamarin.Google.Android.Play.Asset.Delivery.Ktx" />
92+
<PackageReference Remove="Xamarin.Google.Android.Play.Core.Ktx" />
93+
<PackageReference Remove="Xamarin.Google.Android.Play.Feature.Delivery.Ktx" />
94+
<PackageReference Remove="Xamarin.Google.Android.Play.Review.Ktx" />
95+
</ItemGroup>
96+
6997
<!--
7098
./samples/dotnet/BuildAllMauiApp/BuildAllMauiApp.csproj :
7199
error NU1605: Detected package downgrade: Xamarin.AndroidX.Security.SecurityCrypto from 1.1.0-alpha03 to 1.0.0.7.

samples/dotnet/BuildAllMauiApp/Platforms/Android/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
44
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
55
<uses-permission android:name="android.permission.INTERNET" />
6-
<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="31" />
76
</manifest>

samples/dotnet/Directory.Packages.GPS-FB-MLKit.props

Lines changed: 0 additions & 22 deletions
This file was deleted.

samples/dotnet/Directory.Packages.props

Lines changed: 0 additions & 4 deletions
This file was deleted.

samples/dotnet/Directory.Packages.samples.props

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)