dotnet / dotnet/android

`GenerateBindings` and `AddBindingsToCompile` are not run for a project build happening under `_ResolveAssemblies` causing incremental builds to break

Open
#9,007 13 comments 0 reactions 2 assignees Assigned to @dellis1972 View on GitHub
Area: App+Library Build
Dominant language
C#
Stars
2.1k
Forks
579
Avg merge
1d 19h
Merged PRs (30d)
252

Description

### Android framework version

net8.0-android

### Affected platform version

34.0.95

### Description

[pr2.zip](https://github.com/user-attachments/files/15604525/pr2.zip)

In this binlog, there are two builds of `Uno.UI.BindingHelper.Android.netcoremobile.csproj` with IDs 351 and 88.

The build for 351 is fine and correct (it's resulting from `ResolveProjectReferences` on `SamplesApp.netcoremobile.csproj`)

The build for 88 is very problematic, it's resulting from `_ResolveAssemblies` which sets

https://github.com/xamarin/xamarin-android/blob/b521487d0226db265baaa83f0f53e2e75497c420/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets#L91

Now that this build is happening with `_ComputeFilesToPublishForRuntimeIdentifiers` being true, the [Microsoft.Android.Sdk.BuildOrder.targets](https://github.com/xamarin/xamarin-android/blob/main/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets) isn't imported. Then, `CompileDependsOn` is missing the `GenerateBindings` and `AddBindingsToCompile` targets. This causes `_GenerateCompileDependencyCache` to not include some files, breaking things VERY badly.

In the above binlog, `_GenerateCompileDependencyCache` of build 351 is run first, then that of build 88 which overwritten `Uno.UI.BindingHelper.Android.netcoremobile.csproj.CoreCompileInputs.cache` causing `Uno.UI.BindingHelper.Android.netcoremobile` to be rebuilt unnecessarily, which then causes almost everything to be rebuilt.

### Steps to Reproduce

Binlog shows it all I think. If more info is needed, let me know.

### Did you find any workaround?

_No response_

### Relevant log output

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.