Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Xamarin.Android.Build.Tasks] fix cases of missing @(Reference) #7947

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Apr 11, 2023

Context: https://github.com/dotnet/msbuild/blob/c75672a6e7387bc5c1f99c166e9277351144b14c/src/Tasks/Microsoft.Common.CurrentVersion.targets#L2327
Fixes: dotnet/maui#10154

This partially reverts c1efcb5.

Previously, we removed this change because it broke .NET MAUI's build
with:

Unable to open file 'obj\Release\net8.0-android\android-x64\aot\x86_64\Microsoft.Maui.Controls.resources\temp.s': Permission denied

The problem being that the .NET SDK was placing satellite assemblies
in the @(ResolvedFileToPublish) item group.

Let's apply our change from before, but also set
$(ResolveAssemblyReferencesFindRelatedSatellites) to false for
our "inner build" per $(RuntimeIdentifier).

This solves the original issue for dotnet/maui#10154 without changing
behavior of satellite assemblies.

I added .resx files in our new test, and assert that satellite
assemblies are inside the resulting .apk for good measure.

Context: https://github.com/dotnet/msbuild/blob/c75672a6e7387bc5c1f99c166e9277351144b14c/src/Tasks/Microsoft.Common.CurrentVersion.targets#L2327
Fixes: dotnet/maui#10154

This partially reverts c1efcb5.

Previously, we removed this change because it broke .NET MAUI's build
with:

    Unable to open file 'obj\Release\net8.0-android\android-x64\aot\x86_64\Microsoft.Maui.Controls.resources\temp.s': Permission denied

The problem being that the .NET SDK was placing satellite assemblies
in the `@(ResolvedFileToPublish)` item group.

Let's apply our change from before, but also set
`$(ResolveAssemblyReferencesFindRelatedSatellites)` to `false` for
our "inner build" per `$(RuntimeIdentifier)`.

This solves the original issue for dotnet/maui#10154 without changing
behavior of satellite assemblies.

I added `.resx` files in our new test, and assert that satellite
assemblies make to apps for good measure.
@jonathanpeppers jonathanpeppers marked this pull request as ready for review April 11, 2023 21:27
@jonathanpeppers jonathanpeppers merged commit cd9c9ff into dotnet:main Apr 12, 2023
@jonathanpeppers jonathanpeppers deleted the fix-maui-10154-again branch April 12, 2023 14:57
grendello added a commit to grendello/xamarin-android that referenced this pull request Apr 12, 2023
* main:
  [Xamarin.Android.Build.Tasks] fix cases of missing `@(Reference)` (dotnet#7947)
  Bumping to the correct monodroid commit
  Trying to bump monodroid to run debugger-tests
  Pass timeout to runtime
grendello added a commit to grendello/xamarin-android that referenced this pull request Apr 14, 2023
* main:
  Bump to xamarin/Java.Interop/main@554d819 (dotnet#7951)
  [Microsoft.Android.Sdk.ILLink] fix crash when TZ changes (dotnet#7956)
  [tests] Port 'Xamarin.Android.JcwGen-Tests.JcwGen-Tests' to .NET (dotnet#7949)
  [Xamarin.Android.Build.Tasks] remove `pdb2mdb` (dotnet#7950)
  [ci] Add some extra params to configure the test templates (dotnet#7955)
  Convert `/tools` and `/build-tools` projects from `net472` to `$(DotNetStableTargetFramework)` (dotnet#7943)
  [Xamarin.Android.Build.Tasks] fix cases of missing `@(Reference)` (dotnet#7947)
  Bump com.android.tools:r8 from 4.0.52 to 8.0.40 (dotnet#7934)
  Bump to xamarin/Java.Interop/main@a172402 (dotnet#7944)
  [Xamarin.Android] Remove OpenTK, sqlite-xamarin, System.EnterpriseServices. (dotnet#7940)
  [ci] Stop building classic test suites. (dotnet#7938)
  Bumping to the correct monodroid commit
  Trying to bump monodroid to run debugger-tests
  Pass timeout to runtime
@jonathanpeppers
Copy link
Member Author

Yay, this time around it didn't break the MAUI build! dotnet/maui#14443

@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assembly load error in Android app referencing another project referencing a DLL assembly
2 participants