8000 Unable to build .NET 9 Android Maui app when targeting non default architectures · Issue #48890 · dotnet/sdk · GitHub
[go: up one dir, main page]

Skip to content
Unable to build .NET 9 Android Maui app when targeting non default architectures #48890
@Axemasta

Description

@Axemasta

Describe the bug

.NET 9 for maui introduced 64-bit architectures by default, I've recently targeted the non default architectures are they are required for my apps install base:

<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android' and '$(Configuration)' == 'Release'">
	<RuntimeIdentifiers>android-arm;android-arm64;android-x86;android-x64</RuntimeIdentifiers>
</PropertyGroup>

Whilst I didn't have a problem building my maui app for release dotnet build -f net9-android -c Release, I discovered my build pipeline was unable to execute the build commands.

There is a workaround for this here and I've got these architectures building.

I was asked to share a binlog of the failing commands without the workaround present here. There are 2 binlogs attached, I was asked to raise an issue on here since there appear to be issues with .targets

I have uploaded the binlogs to this issue aswell

8170 bin logs.zip

To Reproduce1

  • Add <RuntimeIdentifiers>android-arm;android-arm64;android-x86;android-x64</RuntimeIdentifiers> to a .NET 9 maui app
  • Attempt to build the app on a hosted azure agent

Exceptions (if any)

Users/runner/hostedtoolcache/dotnet/sdk/9.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1047: Assets file '/Users/runner/work/1/s/src/MyApp/obj/project.assets.json' doesn't have a target for 'net9.0-android/android-arm'. Ensure that restore has run and that you have included 'net9.0-android' in the TargetFrameworks for your project. You may also need to include 'android-arm' in your project's RuntimeIdentifiers. [/Users/runner/work/1/s/src/MyApp/MyApp.csproj::TargetFramework=net9.0-android]

Further technical details

Environment details for the agent

Pool: [Azure Pipelines](https://dev.azure.com/InfotechnicsLtd/f95487dd-cfce-4e59-b714-1be9164060ef/_settings/agentqueues?poolId=&queueId=122)
Image: macOS-14
Agent: Hosted Agent

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0