-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix Android build failure by explicitly specifying build-tools 36.0.0 #33727
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
Conversation
…35 references - Update AndroidSdkBuildToolsVersion from 33.0.0 to 36.0.0 in eng/Versions.props - Remove IsDefault="True" from API 35 (only API 36 should be default now) - Remove outdated FIXME comment about API 35 from ui-tests-build-sample.yml This aligns the MSBuild property with the explicit buildToolsVersion in build.gradle and ensures provisioning scripts install the correct build-tools version. Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
|
/azp run maui-pr-uitests, maui-pr-devicetests |
|
Azure Pipelines successfully started running 2 pipeline(s). |
- Remove AndroidSdkBuildToolsVersion property from eng/Versions.props - Remove build-tools provisioning line from src/Provisioning/Provisioning.csproj The gradle file now explicitly specifies buildToolsVersion "36.0.0" directly, making this MSBuild property unnecessary. Build-tools can be installed through Android SDK Manager or other means as needed. Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
|
Azure Pipelines successfully started running 2 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes Android build failures caused by Android Gradle Plugin (AGP) 8.11.1's auto-selection of build-tools 35.0.0, which isn't commonly installed. The solution bumps Android SDK from API 35 to API 36 and explicitly specifies build-tools 36.0.0 to override AGP's problematic inference behavior.
Changes:
- Updated Android native module to use compileSdk/targetSdk 36 with explicit build-tools 36.0.0
- Modernized Gradle build configuration to use Gradle 8+ APIs
- Removed obsolete build-tools provisioning and MSBuild properties
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Core/AndroidNative/maui/build.gradle | Bumped compileSdk/targetSdk to 36 and explicitly specified buildToolsVersion "36.0.0" to override AGP auto-selection |
| src/Core/AndroidNative/build.gradle | Modernized Gradle API by replacing deprecated buildDir with layout.buildDirectory |
| eng/Versions.props | Removed obsolete AndroidSdkBuildToolsVersion property and IsDefault="True" from API 35 (only API 36 is default) |
| eng/pipelines/common/ui-tests-build-sample.yml | Removed outdated FIXME comment about API 35 build failures |
| src/Provisioning/Provisioning.csproj | Removed build-tools provisioning entry (gradle now explicitly specifies version) |
|
|
||
| android { | ||
| compileSdk 35 | ||
| compileSdk 36 |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a comment explaining why buildToolsVersion is explicitly specified here. This would help future maintainers understand that this is a workaround for AGP 8.11.1's auto-selection behavior, which tries to use build-tools 35.0.0 (which isn't commonly installed) when compileSdk is 35. The explicit version specification overrides AGP's inference and ensures builds use an available version.
| compileSdk 36 | |
| compileSdk 36 | |
| // Explicitly specify buildToolsVersion to override AGP 8.11.1's auto-selection, | |
| // which can otherwise choose a non-installed build-tools version (for example 35.0.0 when compileSdk is 35). |
|
/azp run maui-pr-uitests, maui-pr-devicetests |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jonathanpeppers
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks OK to me if CI is green.
|
AGP 8.11.1 auto-selects build-tools 35.0.0 for compileSdk 35, which isn't commonly installed. This causes build failures in the Android native module.
Changes
src/Core/AndroidNative/maui/build.gradle
compileSdkfrom 35 to 36buildToolsVersion "36.0.0"to override AGP's auto-selectiontargetSdkfrom 35 to 36src/Core/AndroidNative/build.gradle
buildDirwithlayout.buildDirectory(Gradle 8+ API)eng/Versions.props
IsDefault="True"from API 35 (only API 36 is default now)AndroidSdkBuildToolsVersionproperty (no longer needed)eng/pipelines/common/ui-tests-build-sample.yml
src/Provisioning/Provisioning.csproj
Explicit buildToolsVersion takes precedence over AGP inference, ensuring builds use an available version.
The
AndroidSdkBuildToolsVersionMSBuild property has been removed as it's no longer necessary - the gradle file now directly manages the build-tools version. Build-tools can be installed through Android SDK Manager or other standard Android development tools as needed.Original prompt
Create a PR with these changes. They should be good to go and need no further updates
**Chronological Review:** 1. Initial phase: User requested checkout of DecorView-Fix PR branch, rebase to main, and create test sample 2. First build attempt: BuildTasks failed with build-tools 35.0.0 not found error 3. Investigation phase: Determined AGP 8.11.1 tries to use build-tools 35.0.0 for compileSdk 35 4. First fix attempt: Changed compileSdk to 36, still failed until explicit buildToolsVersion added 5. Exploration phase: User asked to test AGP 9.x upgrade on new branch 6. AGP upgrade failure: Microsoft.Android.Sdk.Windows 36.1.12 incompatible with Gradle 9.x due to Kotlin type safety 7. Documentation phase: Created detailed bug reports for Microsoft Android SDK team 8. Final resolution: User decided on minimal build-tools fix approach 9. Branch creation: Created fix-android-build-tools-36 with surgical changes 10. Cleanup phase: Verified changes, removed untracked files from previous experimentsIntent Mapping:
Technical Inventory:
Code Archaeology:
Progress Assessment:
Completed:
Created from Copilot CLI via the copilot delegate command.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.