Skip to content

Commit 7d54432

Browse files
[build] delete platform-31 folder on test jobs
Context: #6089 We currently have lots of test failures due to the warning: warning XA1008: The TargetFrameworkVersion (Android API level 30) is lower than the targetSdkVersion (31). Please increase the `$(TargetFrameworkVersion)` or decrease the `android:targetSdkVersion` in the `AndroidManifest.xml` so that the API levels match. Looking at `Properties\AndroidManifest.xml`, Xamarin.ProjectTools generated: <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" /> This appears to be due to the `GetMaxInstalledPlatform()` method: https://github.com/xamarin/xamarin-android/blob/1b71da0cd3a44861b006ac41c77a24eedf066281/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/AndroidSdkResolver.cs#L121-L138 I think what happened is: * #6089 is opened, platform-31 gets installed on many of the CI machines. * Future PRs install `platform-31` side-by-side `platform-S`. And so we ended up with test failures... To fix this for now, manually delete the `sdk/platform-31` folder on test jobs.
1 parent 1b71da0 commit 7d54432

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

build-tools/automation/yaml-templates/setup-test-environment.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ steps:
1919
parameters:
2020
provisionExtraArgs: ${{ parameters.provisionExtraArgs }}
2121

22+
# NOTE: temporarily delete platform-31
23+
24+
- script: rm -rfv "$HOME/Library/Android/sdk/platform-31"
25+
displayName: delete API 31
26+
condition: and(succeeded(), eq(variables['agent.os'], 'Darwin'))
27+
28+
- script: if exist "%USERPROFILE%\android-toolchain\sdk\platform-31" rmdir /s /q "%USERPROFILE%\android-toolchain\sdk\platform-31"
29+
displayName: delete API 31
30+
condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT'))
31+
2232
- script: |
2333
echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/Library/Android/${{ parameters.jdkTestFolder }}"
2434
echo "##vso[task.setvariable variable=DOTNET_TOOL_PATH]$HOME/Library/Android/dotnet/dotnet"

0 commit comments

Comments
 (0)