Skip to content

Commit 97a7c0d

Browse files
[ci] fix builds on main branch (#1303)
Context: https://devdiv.visualstudio.com/DevDiv/DevDiv%20Team/_build/results?buildId=12682126&view=logs&j=784e4eae-0a8d-50ee-7be1-df4337debdeb&t=d146df5a-97f5-55ed-d881-1a15f3c31d98&l=3730 Builds on main are failing on Windows with: Starting a Gradle Daemon (subsequent builds will be faster) Warning: SDK processing. package.xml parsing problem. unrecognized type name: platform. Did you mean archives? Warning: SDK processing. package.xml parsing problem. Unable to create an instance of com.android.repository.impl.generated.v2.TypeDetails java.lang.InstantiationException... Copilot suggested deleting all `package.xml` files from the Android SDK installation. I also updated the instructions to require Microsoft OpenJDK 21, since that is what we are using now.
1 parent 82685db commit 97a7c0d

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The repository uses a **config-driven approach** where all bindings are defined
3333
### Prerequisites
3434
- a recent .NET SDK
3535
- Cake .NET Tool: `dotnet tool install -g cake.tool`
36-
- Microsoft OpenJDK 11 (JDK-17 not supported)
36+
- Microsoft OpenJDK 21
3737
- Android SDK and `$ANDROID_SDK_ROOT` environment variable
3838
- Optional: `api-tools` for API diffs: `dotnet tool install -g api-tools`
3939

build/ci/setup-environment.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,19 @@ steps:
9090
Write-Host "##vso[task.setvariable variable=ANDROID_HOME]${{ parameters.androidSdkRoot }}"
9191
displayName: Set ANDROID_SDK_ROOT and ANDROID_HOME to ${{ parameters.androidSdkRoot }}
9292
93+
- pwsh: |
94+
# Remove problematic package.xml files that cause JAXB parsing issues with Java 21 on Windows
95+
$androidSdkRoot = if ($env:ANDROID_SDK_ROOT) { $env:ANDROID_SDK_ROOT } else { $env:ANDROID_HOME }
96+
if ($androidSdkRoot -and (Test-Path $androidSdkRoot)) {
97+
Write-Host "Removing package.xml files from: $androidSdkRoot"
98+
$files = Get-ChildItem -Path $androidSdkRoot -Filter "package.xml" -Recurse -ErrorAction SilentlyContinue
99+
$files | Remove-Item -Force -ErrorAction SilentlyContinue
100+
Write-Host "Removed $($files.Count) package.xml files"
101+
} else {
102+
Write-Host "Android SDK not found, skipping cleanup"
103+
}
104+
displayName: Clean Android SDK package.xml files
105+
condition: eq(variables['Agent.OS'], 'Windows_NT')
106+
continueOnError: true
107+
93108

0 commit comments

Comments
 (0)