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

[Xamarin.Android.Build.Tasks] fix NRE in <GenerateResourceCaseMap/> #7716

Merged

Conversation

jonathanpeppers
Copy link
Member

Context: dotnet/maui#12520
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=7209613&view=results

dotnet/maui's build fails with:

Task GenerateResourceCaseMap
Parameters
    ResourceDirectory = obj/Debug/net8.0-android/res/
    OutputFile = obj/Debug/net8.0-android/case_map.txt
    AdditionalResourceDirectories
        ...
Errors
    /Users/builder/azdo/_work/2/s/bin/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.0.0-preview.1.119/tools/Xamarin.Android.Resource.Designer.targets(82,3): error XAGRCM7001: System.NullReferenceException: Object reference not set to an instance of an object.
    at Xamarin.Android.Tasks.GenerateResourceCaseMap.RunTask()
    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 17 [/Users/builder/azdo/_work/2/s/src/TestUtils/samples/DeviceTests.Sample/TestUtils.DeviceTests.Sample.csproj]

Note that the Resources parameter is empty. This is apparently a TestUtils.DeviceTests.Sample.csproj project with no @(AndroidResource) files.

Added a null check.

Context: dotnet/maui#12520
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=7209613&view=results

dotnet/maui's build fails with:

    Task GenerateResourceCaseMap
    Parameters
        ResourceDirectory = obj/Debug/net8.0-android/res/
        OutputFile = obj/Debug/net8.0-android/case_map.txt
        AdditionalResourceDirectories
            ...
    Errors
        /Users/builder/azdo/_work/2/s/bin/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.0.0-preview.1.119/tools/Xamarin.Android.Resource.Designer.targets(82,3): error XAGRCM7001: System.NullReferenceException: Object reference not set to an instance of an object.
        at Xamarin.Android.Tasks.GenerateResourceCaseMap.RunTask()
        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 17 [/Users/builder/azdo/_work/2/s/src/TestUtils/samples/DeviceTests.Sample/TestUtils.DeviceTests.Sample.csproj]

Note that the `Resources` parameter is empty. This is apparently a
`TestUtils.DeviceTests.Sample.csproj` project with no
`@(AndroidResource)` files.

Added a null check.
@jonathanpeppers jonathanpeppers merged commit 097f239 into xamarin:main Jan 19, 2023
@jonathanpeppers jonathanpeppers deleted the GenerateResourceCaseMapNRE branch January 19, 2023 14:25
grendello added a commit to grendello/xamarin-android that referenced this pull request Jan 26, 2023
* main: (32 commits)
  [monodroid] Replace `exit()` with `abort()` in native code (xamarin#7734)
  Bump to xamarin/java.interop@8a1ae57 (xamarin#7738)
  [build] bump `$(AndroidNet7Version)` (xamarin#7737)
  Bump to xamarin/java.interop@1366d99 (xamarin#7718)
  [Xamarin.Android.Build.Tasks] fix AndroidGenerateResourceDesigner (xamarin#7721)
  Bump to xamarin/monodroid@50faac94 (xamarin#7725)
  Revert "[Xamarin.Android.Build.Tasks] fix cases of missing `@(Reference)` (xamarin#7642)" (xamarin#7726)
  [marshal methods] Properly support arrays of arrays (xamarin#7707)
  Bump to dotnet/installer@9962c6a 8.0.100-alpha.1.23063.11 (xamarin#7677)
  [Actions] Add action to bump the hash used for the unified pipeline (xamarin#7712)
  Bump to xamarin/xamarin-android-tools@099fd95 (xamarin#7709)
  [ci] Move build stages into yaml templates (xamarin#7553)
  [Xamarin.Android.Build.Tasks] fix NRE in `<GenerateResourceCaseMap/>` (xamarin#7716)
  [ci] Pass token when building Designer tests (xamarin#7715)
  [Mono.Android] Android.Telecom.InCallService.SetAudioRoute() + enum (xamarin#7711)
  [Mono.Android] Fix some incorrect enums. (xamarin#7670)
  [Xamarin.Android.Build.Tasks] _Microsoft.Android.Resource.Designer namespace (xamarin#7681)
  LEGO: Merge pull request 7713
  [Xamarin.Android.Build.Tasks] lazily populate Resource lookup (xamarin#7686)
  [Xamarin.Android.Build.Tasks] skip XA1034 logic in some cases (xamarin#7680)
  ...
grendello added a commit to grendello/xamarin-android that referenced this pull request Jan 30, 2023
* main:
  [marshal methods] Properly support arrays of arrays (xamarin#7707)
  Bump to dotnet/installer@9962c6a 8.0.100-alpha.1.23063.11 (xamarin#7677)
  [Actions] Add action to bump the hash used for the unified pipeline (xamarin#7712)
  Bump to xamarin/xamarin-android-tools@099fd95 (xamarin#7709)
  [ci] Move build stages into yaml templates (xamarin#7553)
  [Xamarin.Android.Build.Tasks] fix NRE in `<GenerateResourceCaseMap/>` (xamarin#7716)
  [ci] Pass token when building Designer tests (xamarin#7715)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants