This repository was archived by the owner on Jun 1, 2026. It is now read-only.
Fix CI/CD pipeline build errors for .NET Android workflow in PR #4#5
Merged
Conversation
Co-authored-by: cail <153030+cail@users.noreply.github.com>
Co-authored-by: cail <153030+cail@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix CI/CD pipeline build errors for AndroidDrawing library
Fix CI/CD pipeline build errors for .NET Android workflow in PR #4
Oct 20, 2025
cail
approved these changes
Oct 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR fixes the GitHub Actions workflow build failures that were preventing PR #4 from building successfully. The workflow now successfully builds both the AndroidDrawing library and the example Android application with .NET 9.0 on Ubuntu latest.
Problem
The CI/CD pipeline was failing at the Android workload installation step with the following error:
The root cause was that
dotnet workload install androidwas being executed in the repository root directory, which contains two.csprojfiles:AndroidDrawing.csproj(legacy Xamarin project)AndroidDrawing.dotnet.csproj(new .NET 9.0 project)The workload installer couldn't determine which project to target and aborted with exit code 1.
Changes
1. Workflow Configuration Fix
Modified
.github/workflows/build-dotnet-android.ymlto run the Android workload installation from a directory containing only one project file:This eliminates the ambiguity by running the command in a directory with a single project file.
2. MAUI Package Version Resolution
Updated both
AndroidDrawing.dotnet.csprojandexamples/CanvasExample/CanvasExample.csprojto use an explicit MAUI version:This fixes the NU1604 warning about missing lower bound in dependency version.
3. Android Manifest Target SDK
Added
android:targetSdkVersion="35"toexamples/CanvasExample/AndroidManifest.xml:This aligns with the build target (API level 35) and eliminates the XA1006 warning.
4. Type Naming Conflict Resolution
Renamed
CanvasViewtoDrawingViewinexamples/CanvasExample/MainActivity.csto avoid type naming conflicts between the example app and the library.Verification
All workflow steps now execute successfully:
✅ Checkout code - Uses actions/checkout@v4
✅ Setup .NET - Installs .NET 9.0.x
✅ Install Android workload - Completes without errors
✅ Restore library dependencies - Succeeds
✅ Build library - Produces
bin/Release/net9.0-android/AndroidDrawing.dotnet.dll✅ Restore example app dependencies - Succeeds
✅ Build example app - Produces
examples/CanvasExample/bin/Release/net9.0-android/CanvasExample.dllThe builds complete with only minor warnings (deprecated Android Canvas.Matrix API) and no errors. The workflow is ready for GitHub Actions execution on push/PR to main/master branches.
Testing
Tested locally by running all workflow steps sequentially:
All steps completed successfully with exit code 0.
Fixes #4
Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.