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

[DO NOT MERGE] TFM net9.0 #850

Draft
wants to merge 62 commits into
base: main
Choose a base branch
from
Draft

[DO NOT MERGE] TFM net9.0 #850

wants to merge 62 commits into from

Conversation

moljac
Copy link
Contributor

@moljac moljac commented Feb 21, 2024

Dogfooding net9.0 only TFM for AndroidX (AX) bindings.

It is to be determined if and when to merge. Thus DO-NOT-MERGE in title and label + draft status.

Some metadata had to be fixed. And some APIs have changed and this needs some investigation

GPS-FB-MLKit PR is Work in Progress (WIP).

Does this change any of the generated binding API's?

Probably. Not sure yet. There were some Metadata changes.

Describe your contribution

In May support for Xamarin.Classic (monoandroid12) and net6.0 will be dropped and this is recon PR to see what is ahead of the team.

@moljac moljac added the do-not-merge PR is still in progress and is not ready to be merged label Feb 21, 2024
@moljac moljac self-assigned this Feb 21, 2024
@moljac
Copy link
Contributor Author

moljac commented Feb 25, 2024

Samples error

DotNetBuild           ./samples/dotnet/BuildAllMauiApp.sln / BuildAllMauiApp
MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
Restore complete (17,5s)
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  BuildAllMauiApp failed with errors (2,9s)
    /usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.99.0-preview.1.151/tools/Xamarin.Android.Common.targets(579,3): error XA1018: Specified AndroidManifest file does not exist: ./samples/dotnet/BuildAllMauiApp/AndroidManifest.xml. [./samples/dotnet/BuildAllMauiApp/BuildAllMauiApp.csproj]
dotnet build samples/dotnet/BuildAllMauiApp/BuildAllMauiApp.csproj
MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
Restore complete (14,9s)
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  BuildAllMauiApp failed with errors (1,4s)
    /usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.99.0-preview.1.151/tools/Xamarin.Android.Common.targets(579,3): error XA1018: Specified AndroidManifest file does not exist: ./samples/dotnet/BuildAllMauiApp/AndroidManifest.xml. [./samples/dotnet/BuildAllMauiApp/BuildAllMauiApp.csproj]
tree samples/dotnet/BuildAllMauiApp/
samples/dotnet/BuildAllMauiApp/
├── App.xaml
├── App.xaml.cs
├── AppShell.xaml
├── AppShell.xaml.cs
├── BuildAllMauiApp.csproj
├── MainPage.xaml
├── MainPage.xaml.cs
├── MauiProgram.cs
├── Platforms
│   ├── Android
│   │   ├── AndroidManifest.xml
│   │   ├── MainActivity.cs
│   │   ├── MainApplication.cs
│   │   └── Resources
│   │       └── values
│   │           └── colors.xml
│   ├── MacCatalyst
│   │   ├── AppDelegate.cs
│   │   ├── Info.plist
│   │   └── Program.cs
│   ├── Tizen
│   │   ├── Main.cs
│   │   └── tizen-manifest.xml
│   ├── Windows
│   │   ├── App.xaml
│   │   ├── App.xaml.cs
│   │   ├── Package.appxmanifest
│   │   └── app.manifest
│   └── iOS
│       ├── AppDelegate.cs
│       ├── Info.plist
│       └── Program.cs
└── Resources
    ├── AppIcon
    │   ├── appicon.svg
    │   └── appiconfg.svg
    ├── Fonts
    │   ├── OpenSans-Regular.ttf
    │   └── OpenSans-Semibold.ttf
    ├── Images
    │   └── dotnet_bot.svg
    ├── Raw
    │   └── AboutAssets.txt
    ├── Splash
    │   └── splash.svg
    └── Styles
        ├── Colors.xaml
        └── Styles.xaml

16 directories, 33 files

@moljac
Copy link
Contributor Author

moljac commented Oct 2, 2024

Build error:

    ./generated/androidx.emoji2.emoji2-emojipicker/androidx.emoji2.emoji2-emojipicker.csproj : error NU1605: 
      Warning As Error: Detected package downgrade: Xamarin.AndroidX.Emoji2 from 1.5.0.1 to 1.2.0.2. Reference the package directly from the project to select a different version. 
       Xamarin.AndroidX.Emoji2.EmojiPicker -> Xamarin.AndroidX.AppCompat -> Xamarin.AndroidX.Emoji2 (>= 1.5.0.1) 
       Xamarin.AndroidX.Emoji2.EmojiPicker -> Xamarin.AndroidX.Emoji2 (>= 1.2.0.2 && < 1.2.1)

In config.json

      {
        "groupId": "androidx.emoji2",
        "artifactId": "emoji2",
        "version": "1.2.0",
        "nugetVersion": "1.2.0.2",
        "nugetId": "Xamarin.AndroidX.Emoji2",
        "dependencyOnly": true
      },

changing it to fix the NuGet error to

      {
        "groupId": "androidx.emoji2",
        "artifactId": "emoji2",
        "version": "1.5.0",
        "nugetVersion": "1.5.0.1",
        "nugetId": "Xamarin.AndroidX.Emoji2",
        "dependencyOnly": true
      },

causes binderator error

Dependency errors : 1
1
	System.Exception: 
Artifact
	androidx.emoji2.emoji2-emojipicker:1.5.0
has unknown 'Runtime' dependency 
	androidx.emoji2.emoji2:[1.2.0]
Either fulfill or exclude this dependency.


An error occurred when executing task 'binderate'.
Error: .NET CLI: Process returned an error (exit code 1).

More investigation:

find ./generated -iname "*.csproj" -exec grep -Hni "1\.2\.0\.2" {} \;
./generated/androidx.emoji2.emoji2-emojipicker/androidx.emoji2.emoji2-emojipicker.csproj:112:    <PackageReference Include="Xamarin.AndroidX.Emoji2" Version="[1.2.0.2, 1.2.1)" PrivateAssets="none" />

Workaround (for now)

Exclude runtime dependency:

      {
        "groupId": "androidx.emoji2",
        "artifactId": "emoji2-emojipicker",
        "version": "1.5.0",
        "nugetVersion": "1.5.0.1",
        "nugetId": "Xamarin.AndroidX.Emoji2.EmojiPicker",
        "excludedRuntimeDependencies": "androidx.emoji2:emoji2",
        "dependencyOnly": false
      },

@moljac
Copy link
Contributor Author

moljac commented Oct 3, 2024

/azp run

Copy link

Azure Pipelines failed to run 1 pipeline(s).

@moljac moljac marked this pull request as draft October 22, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge PR is still in progress and is not ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants