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

[net9.0] Update dependencies from dotnet/android #24539

Merged
merged 23 commits into from
Sep 27, 2024

Conversation

dotnet-maestro[bot]
Copy link
Contributor

@dotnet-maestro dotnet-maestro bot commented Aug 30, 2024

This pull request updates the following dependencies

From https://github.com/dotnet/android

  • Subscription: dee7bee5-1549-44b6-57bb-08dca723c58f
  • Build: main-7d730228379df63d318603d45a354fe9a2b4274d-1
  • Date Produced: September 26, 2024 9:37:27 PM UTC
  • Commit: 7d730228379df63d318603d45a354fe9a2b4274d
  • Branch: refs/heads/main

@dotnet-maestro dotnet-maestro bot requested a review from a team as a code owner August 30, 2024 12:53
@dotnet-policy-service dotnet-policy-service bot added area/infrastructure 🏗️ area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions labels Aug 30, 2024
@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho
Copy link
Member

rmarinho commented Sep 3, 2024

@jonathanpeppers seems we are getting a error on building the templates.

https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=10139336&view=ms.vss-test-web.build-test-results-tab

  [97/97] System.Private.CoreLib.dll -> System.Private.CoreLib.dll.so
Number of descriptors: 131; index entries: 262
Header size: 20; index entry size: 12; descriptor size: 28
Number of descriptors: 131; index entries: 262
Header size: 20; index entry size: 12; descriptor size: 28
Build FAILED.
/Users/builder/azdo/_work/2/s/bin/dotnet/packs/Microsoft.Android.Sdk.Darwin/35.0.0-rc.2.89/tools/Xamarin.Android.Tooling.targets(62,5): error : An exception occurred while validating the Java SDK installation in '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home' that was found while searching the paths from '`/usr/libexec/java_home -X`'. Ensure that the Android section of the Visual Studio options has a valid Java SDK directory configured. To use a custom SDK path for a command line build, set the 'JavaSdkDirectory' MSBuild property to the custom path. Exception: Could not find required file `jar` within `/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home`; is this a valid JDK? (Parameter 'homePath') [/Users/builder/azdo/_work/_temp/test-dir/Buildmauiblazor579060041/Buildmauiblazor579060041.csproj::TargetFramework=net9.0-android]
/Users/builder/azdo/_work/2/s/bin/dotnet/packs/Microsoft.Android.Sdk.Darwin/35.0.0-rc.2.89/tools/Xamarin.Android.Tooling.targets(62,5): error : An exception occurred while validating the Java SDK installation in '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home' that was found while searching the paths from '`/usr/libexec/java_home -X`'. Ensure that the Android section of the Visual Studio options has a valid Java SDK directory configured. To use a custom SDK path for a command line build, set the 'JavaSdkDirectory' MSBuild property to the custom path. Exception: Could not find required file `jar` within `/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home`; is this a valid JDK? (Parameter 'homePath') [/Users/builder/azdo/_work/_temp/test-dir/Buildmauiblazor579060041/Buildmauiblazor579060041.csproj::TargetFramework=net9.0-android]
/Users/builder/azdo/_work/2/s/bin/dotnet/packs/Microsoft.Android.Sdk.Darwin/35.0.0-rc.2.89/tools/Xamarin.Android.Tooling.targets(62,5): error : An exception occurred while validating the Java SDK installation in '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home' that was found while searching the paths from '`/usr/libexec/java_home -X`'. Ensure that the Android section of the Visual Studio options has a valid Java SDK directory configured. To use a custom SDK path for a command line build, set the 'JavaSdkDirectory' MSBuild property to the custom path. Exception: Could not find required file `jar` within `/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home`; is this a valid JDK? (Parameter 'homePath') [/Users/builder/azdo/_work/_temp/test-dir/Buildmauiblazor579060041/Buildmauiblazor579060041.csproj::TargetFramework=net9.0-android]
    0 Warning(s)
    3 Error(s)
    ``` 

@jonathanpeppers
Copy link
Member

@rmarinho they want to require JDK 17 going forward:

There is a workaround if you need to use JDK 11, but I would notify Jon Pryor if you really need to do that.

@rmarinho
Copy link
Member

rmarinho commented Sep 5, 2024

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho rmarinho requested review from jonathanpeppers and mattleibow and removed request for jsuarezruiz September 5, 2024 16:15
jonathanpeppers
jonathanpeppers previously approved these changes Sep 5, 2024
@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho
Copy link
Member

/azp run MAUI-UITests-public

@rmarinho
Copy link
Member

/azp run MAUI-DeviceTests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rmarinho
Copy link
Member

@jonathanpeppers @Eilon

D:\a\_work\1\s\src\Core\src\Handlers\HybridWebView\HybridWebViewHandler.Android.cs(50,5): error IL2026: Using member 'Java.Interop.ExportAttribute.ExportAttribute(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. [ExportAttribute] uses dynamic features. [D:\a\_work\1\s\src\Core\src\Core.csproj::TargetFramework=net9.0-android35.0]

dotnet-maestro bot and others added 6 commits September 26, 2024 17:29
…0-rc.2.24429.1+azdo.10133834

Microsoft.Android.Sdk.Windows
 From Version 35.0.0-rc.2.87 -> To Version 35.0.0-rc.2.89
…-e237401724371b999f3113778f50591de5f63ccb-1

Microsoft.Android.Sdk.Windows
 From Version 35.0.0-rc.2.89 -> To Version 35.0.0-rc.2.93
…-550f66e519b2efddddd864bf9dc8e47e953b031c-1

Microsoft.Android.Sdk.Windows
 From Version 35.0.0-rc.2.93 -> To Version 35.0.0-rc.2.96
…-ac8a922d495dff28fdc29310d509a21fa139b883-1

Microsoft.Android.Sdk.Windows
 From Version 35.0.0-rc.2.96 -> To Version 35.0.0-rc.2.99
@rmarinho
Copy link
Member

new one

D:\a\_work\1\s\bin\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.130\tools\Xamarin.Android.Common.Debugging.targets(139,2): error XABLD7009: System.InvalidOperationException: Internal error: archive DSO stub location not known for architecture 'X86_64' [D:\a\_work\1\s\src\BlazorWebView\tests\MauiDeviceTests\MauiBlazorWebView.DeviceTests.csproj::TargetFramework=net9.0-android]
D:\a\_work\1\s\bin\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.130\tools\Xamarin.Android.Common.Debugging.targets(139,2): error XABLD7009:    at Xamarin.Android.Tasks.DSOWrapperGenerator.WrapIt(AndroidTargetArch targetArch, String payloadFilePath, String outputFileName, IBuildEngine4 buildEngine, TaskLoggingHelper log) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/DSOWrapperGenerator.cs:line 86 [D:\a\_work\1\s\src\BlazorWebView\tests\MauiDeviceTests\MauiBlazorWebView.DeviceTests.csproj::TargetFramework=net9.0-android]
D:\a\_work\1\s\bin\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.130\tools\Xamarin.Android.Common.Debugging.targets(139,2): error XABLD7009:    at Xamarin.Android.Tasks.BuildApk.AddRuntimeConfigBlob(ZipArchiveEx apk) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 404 [D:\a\_work\1\s\src\BlazorWebView\tests\MauiDeviceTests\MauiBlazorWebView.DeviceTests.csproj::TargetFramework=net9.0-android]
D:\a\_work\1\s\bin\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.130\tools\Xamarin.Android.Common.Debugging.targets(139,2): error XABLD7009:    at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi(String[] supportedAbis, String apkInputPath, String apkOutputPath, Boolean debug, Boolean compress, IDictionary`2 compressedAssembliesInfo, String assemblyStoreApkName) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 215 [D:\a\_work\1\s\src\BlazorWebView\tests\MauiDeviceTests\MauiBlazorWebView.DeviceTests.csproj::TargetFramework=net9.0-android]

@jonathanpeppers
Copy link
Member

@rmarinho I'm going to revert this for now:

To see if that unblocks the build here.

jonathanpeppers added a commit to dotnet/android that referenced this pull request Sep 26, 2024
…<PrepareDSOWrapperState/>`

Context: dotnet/maui#24539 (comment)

In .NET MAUI's build, they failed to bump .NET for Android because of
the following error:

    dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.130\tools\Xamarin.Android.Common.Debugging.targets(139,2): error XABLD7009: System.InvalidOperationException: Internal error: archive DSO stub location not known for architecture 'X86'
    at Xamarin.Android.Tasks.DSOWrapperGenerator.WrapIt(AndroidTargetArch targetArch, String payloadFilePath, String outputFileName, IBuildEngine4 buildEngine, TaskLoggingHelper log) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/DSOWrapperGenerator.cs:line 86
    at Xamarin.Android.Tasks.BuildApk.AddRuntimeConfigBlob(ZipArchiveEx apk) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 404
    at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi(String[] supportedAbis, String apkInputPath, String apkOutputPath, Boolean debug, Boolean compress, IDictionary`2 compressedAssembliesInfo, String assemblyStoreApkName) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 215
    at Xamarin.Android.Tasks.BuildApk.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 357
    at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25

In 5ebcb1d, we introduced some MSBuild `RegisterTaskObject()` usage
that failed in specific way:

* MAUI has a `.sln` with multiple "app" projects: device tests,
  samples, etc. building in parallel

* The `<PrepareDSOWrapperState/>` MSBuild task runs for project A,
  saving x64 and arm64 values.

* Project B goes to run `<BuildApk/>` but x86 is missing.

For now, we can fix this by using `ProjectSpecificTaskObjectKey()` that
wraps the key with a `Tuple` such as:

    (key, WorkingDirectory)

Which, should result in a unique key per project.

In a future PR, we could consider removing this `RegisterTaskObject()`
usage completely, and doing all the work inside the `<BuildApk/>`
MSBuild task instead.
dotnet-maestro bot and others added 2 commits September 26, 2024 22:25
…-7d730228379df63d318603d45a354fe9a2b4274d-1

Microsoft.Android.Sdk.Windows
 From Version 35.0.0-rc.2.130 -> To Version 35.0.1-ci.main.1
Looking up build with BAR id 240097
Updating 'Microsoft.Android.Sdk.Windows': '35.0.1-ci.main.1' => '35.0.0-rc.2.134' (from build '9.0.1xx-rc2-b795a653460417af9da75f94e4a487a2665faa7f-1' of 'https://github.com/dotnet/android')
Checking for coherency updates...
Local dependencies updated based on build with BAR id 240097 (9.0.1xx-rc2-b795a653460417af9da75f94e4a487a2665faa7f-1 from https://github.com/dotnet/android@release/9.0.1xx-rc2)
@jonathanpeppers
Copy link
Member

Android 35.0.0-rc.2.134 should have the problematic commit reverted.

@rmarinho
Copy link
Member

rmarinho commented Sep 27, 2024

@jonathanpeppers I think we still see some failures

Number of descriptors: 131; index entries: 262
Header size: 20; index entry size: 12; descriptor size: 28
Number of descriptors: 131; index entries: 262
Header size: 20; index entry size: 12; descriptor size: 28
Build FAILED.

https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=10290757&view=logs&j=f3581e0c-6e47-5bad-9d98-3a98bd10977c&s=6ce83ee1-284e-53a3-5e1f-512e684894b4&t=c4ab484b-c280-569b-d411-8885b3933549&l=2228

@jonathanpeppers
Copy link
Member

These are debug messages, not an error.

The error I'm seeing is:

/Users/builder/azdo/_work/2/s/bin/dotnet/packs/Microsoft.Android.Sdk.Darwin/35.0.0-rc.2.134/tools/Xamarin.Android.Tooling.targets(62,5):
An exception occurred while validating the Java SDK installation in '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home' that was found while searching the paths from '`/usr/libexec/java_home -X`'. Ensure that the Android section of the Visual Studio options has a valid Java SDK directory configured. To use a custom SDK path for a command line build, set the 'JavaSdkDirectory' MSBuild property to the custom path. Exception: Could not find required file `jar` within `/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home`; is this a valid JDK? (Parameter 'homePath') 

And then it found no valid JDK 17.

I don't think there is a change that caused this, except for us requiring JDK 17 now.

@rmarinho rmarinho added this to the 9.0-rc2 milestone Sep 27, 2024
Redth
Redth previously approved these changes Sep 27, 2024
@Redth
Copy link
Member

Redth commented Sep 27, 2024

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho
Copy link
Member

@jonathanpeppers does this seem something ? or just random?

D:\a\_work\1\s\bin\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.134\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : Precompiling failed for D:\a\_work\1\s\artifacts\obj\TestUtils.DeviceTests.Sample\Release\net9.0-android\android-x64\linked\System.Net.Sockets.dll with exit code 57005. [D:\a\_work\1\s\src\TestUtils\samples\DeviceTests.Sample\TestUtils.DeviceTests.Sample.csproj::TargetFramework=net9.0-android]
D:\a\_work\1\s\bin\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.134\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : Mono Ahead of Time compiler - compiling assembly D:\a\_work\1\s\artifacts\obj\TestUtils.DeviceTests.Sample\Release\net9.0-android\android-x64\linked\System.Net.Sockets.dll [D:\a\_work\1\s\src\TestUtils\samples\DeviceTests.Sample\TestUtils.DeviceTests.Sample.csproj::TargetFramework=net9.0-android]
D:\a\_work\1\s\bin\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.134\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : AOTID 7FA1204E-6434-34E8-9EFC-665E3DA43BCF [D:\a\_work\1\s\src\TestUtils\samples\DeviceTests.Sample\TestUtils.DeviceTests.Sample.csproj::TargetFramework=net9.0-android]
D:\a\_work\1\s\bin\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.134\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : Using profile data file 'D:\a\_work\1\s\.buildtasks\maui.aotprofile' [D:\a\_work\1\s\src\TestUtils\samples\DeviceTests.Sample\TestUtils.DeviceTests.Sample.csproj::TargetFramework=net9.0-android]
D:\a\_work\1\s\bin\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.134\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : Using profile data file 'D:\a\_work\1\s\.buildtasks\maui-blazor.aotprofile' [D:\a\_work\1\s\src\TestUtils\samples\DeviceTests.Sample\TestUtils.DeviceTests.Sample.csproj::TargetFramework=net9.0-android]
D:\a\_work\1\s\bin\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.134\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : * Assertion at D:\a\_work\1\s\src\mono\mono\mini\aot-compiler.c:13502, condition `res == len' not met [D:\a\_work\1\s\src\TestUtils\samples\DeviceTests.Sample\TestUtils.DeviceTests.Sample.csproj::TargetFramework=net9.0-android]
    8726 Warning(s)
    1 Error(s)

@rmarinho rmarinho merged commit b27176d into net9.0 Sep 27, 2024
118 of 122 checks passed
@rmarinho rmarinho deleted the darc-net9.0-f1bada1f-1a68-493c-924a-7ff8d5601331 branch September 27, 2024 23:39
jonathanpeppers added a commit to dotnet/android that referenced this pull request Sep 30, 2024
…<PrepareDSOWrapperState/>` (#9340)

Context: dotnet/maui#24539 (comment)

In .NET MAUI's build, they failed to bump .NET for Android because of
the following error:

    dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.130\tools\Xamarin.Android.Common.Debugging.targets(139,2): error XABLD7009: System.InvalidOperationException: Internal error: archive DSO stub location not known for architecture 'X86'
    at Xamarin.Android.Tasks.DSOWrapperGenerator.WrapIt(AndroidTargetArch targetArch, String payloadFilePath, String outputFileName, IBuildEngine4 buildEngine, TaskLoggingHelper log) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/DSOWrapperGenerator.cs:line 86
    at Xamarin.Android.Tasks.BuildApk.AddRuntimeConfigBlob(ZipArchiveEx apk) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 404
    at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi(String[] supportedAbis, String apkInputPath, String apkOutputPath, Boolean debug, Boolean compress, IDictionary`2 compressedAssembliesInfo, String assemblyStoreApkName) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 215
    at Xamarin.Android.Tasks.BuildApk.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 357
    at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25

In 5ebcb1d, we introduced some MSBuild `RegisterTaskObject()` usage
that failed in specific way:

* MAUI has a `.sln` with multiple "app" projects: device tests,
  samples, etc. building in parallel

* The `<PrepareDSOWrapperState/>` MSBuild task runs for project A,
  saving x64 and arm64 values.

* Project B goes to run `<BuildApk/>` but x86 is missing.

For now, we can fix this by using `ProjectSpecificTaskObjectKey()` that
wraps the key with a `Tuple` such as:

    (key, WorkingDirectory)

Which, should result in a unique key per project.

In a future PR, we could consider removing this `RegisterTaskObject()`
usage completely, and doing all the work inside the `<BuildApk/>`
MSBuild task instead.
jonathanpeppers added a commit to dotnet/android that referenced this pull request Sep 30, 2024
…<PrepareDSOWrapperState/>` (#9340)

Context: dotnet/maui#24539 (comment)

In .NET MAUI's build, they failed to bump .NET for Android because of
the following error:

    dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.130\tools\Xamarin.Android.Common.Debugging.targets(139,2): error XABLD7009: System.InvalidOperationException: Internal error: archive DSO stub location not known for architecture 'X86'
    at Xamarin.Android.Tasks.DSOWrapperGenerator.WrapIt(AndroidTargetArch targetArch, String payloadFilePath, String outputFileName, IBuildEngine4 buildEngine, TaskLoggingHelper log) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/DSOWrapperGenerator.cs:line 86
    at Xamarin.Android.Tasks.BuildApk.AddRuntimeConfigBlob(ZipArchiveEx apk) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 404
    at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi(String[] supportedAbis, String apkInputPath, String apkOutputPath, Boolean debug, Boolean compress, IDictionary`2 compressedAssembliesInfo, String assemblyStoreApkName) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 215
    at Xamarin.Android.Tasks.BuildApk.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 357
    at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25

In 5ebcb1d, we introduced some MSBuild `RegisterTaskObject()` usage
that failed in specific way:

* MAUI has a `.sln` with multiple "app" projects: device tests,
  samples, etc. building in parallel

* The `<PrepareDSOWrapperState/>` MSBuild task runs for project A,
  saving x64 and arm64 values.

* Project B goes to run `<BuildApk/>` but x86 is missing.

For now, we can fix this by using `ProjectSpecificTaskObjectKey()` that
wraps the key with a `Tuple` such as:

    (key, WorkingDirectory)

Which, should result in a unique key per project.

In a future PR, we could consider removing this `RegisterTaskObject()`
usage completely, and doing all the work inside the `<BuildApk/>`
MSBuild task instead.
jonathanpeppers added a commit to dotnet/android that referenced this pull request Sep 30, 2024
…<PrepareDSOWrapperState/>` (#9340)

Context: dotnet/maui#24539 (comment)

In .NET MAUI's build, they failed to bump .NET for Android because of
the following error:

    dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.130\tools\Xamarin.Android.Common.Debugging.targets(139,2): error XABLD7009: System.InvalidOperationException: Internal error: archive DSO stub location not known for architecture 'X86'
    at Xamarin.Android.Tasks.DSOWrapperGenerator.WrapIt(AndroidTargetArch targetArch, String payloadFilePath, String outputFileName, IBuildEngine4 buildEngine, TaskLoggingHelper log) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/DSOWrapperGenerator.cs:line 86
    at Xamarin.Android.Tasks.BuildApk.AddRuntimeConfigBlob(ZipArchiveEx apk) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 404
    at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi(String[] supportedAbis, String apkInputPath, String apkOutputPath, Boolean debug, Boolean compress, IDictionary`2 compressedAssembliesInfo, String assemblyStoreApkName) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 215
    at Xamarin.Android.Tasks.BuildApk.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 357
    at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25

In 5ebcb1d, we introduced some MSBuild `RegisterTaskObject()` usage
that failed in specific way:

* MAUI has a `.sln` with multiple "app" projects: device tests,
  samples, etc. building in parallel

* The `<PrepareDSOWrapperState/>` MSBuild task runs for project A,
  saving x64 and arm64 values.

* Project B goes to run `<BuildApk/>` but x86 is missing.

For now, we can fix this by using `ProjectSpecificTaskObjectKey()` that
wraps the key with a `Tuple` such as:

    (key, WorkingDirectory)

Which, should result in a unique key per project.

In a future PR, we could consider removing this `RegisterTaskObject()`
usage completely, and doing all the work inside the `<BuildApk/>`
MSBuild task instead.
jonathanpeppers added a commit to dotnet/android that referenced this pull request Sep 30, 2024
…<PrepareDSOWrapperState/>` (#9340)

Context: dotnet/maui#24539 (comment)

In .NET MAUI's build, they failed to bump .NET for Android because of
the following error:

    dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.0-rc.2.130\tools\Xamarin.Android.Common.Debugging.targets(139,2): error XABLD7009: System.InvalidOperationException: Internal error: archive DSO stub location not known for architecture 'X86'
    at Xamarin.Android.Tasks.DSOWrapperGenerator.WrapIt(AndroidTargetArch targetArch, String payloadFilePath, String outputFileName, IBuildEngine4 buildEngine, TaskLoggingHelper log) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/DSOWrapperGenerator.cs:line 86
    at Xamarin.Android.Tasks.BuildApk.AddRuntimeConfigBlob(ZipArchiveEx apk) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 404
    at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi(String[] supportedAbis, String apkInputPath, String apkOutputPath, Boolean debug, Boolean compress, IDictionary`2 compressedAssembliesInfo, String assemblyStoreApkName) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 215
    at Xamarin.Android.Tasks.BuildApk.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs:line 357
    at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25

In 5ebcb1d, we introduced some MSBuild `RegisterTaskObject()` usage
that failed in specific way:

* MAUI has a `.sln` with multiple "app" projects: device tests,
  samples, etc. building in parallel

* The `<PrepareDSOWrapperState/>` MSBuild task runs for project A,
  saving x64 and arm64 values.

* Project B goes to run `<BuildApk/>` but x86 is missing.

For now, we can fix this by using `ProjectSpecificTaskObjectKey()` that
wraps the key with a `Tuple` such as:

    (key, WorkingDirectory)

Which, should result in a unique key per project.

In a future PR, we could consider removing this `RegisterTaskObject()`
usage completely, and doing all the work inside the `<BuildApk/>`
MSBuild task instead.
@samhouts samhouts added the fixed-in-net9.0-nightly This may be available in a nightly release! label Oct 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2024
@samhouts samhouts added the fixed-in-net8.0-nightly This may be available in a nightly release! label Dec 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions fixed-in-net8.0-nightly This may be available in a nightly release! fixed-in-net9.0-nightly This may be available in a nightly release!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants