Skip to content

Commit b60acfe

Browse files
[build] fixes for failing Windows build
Context: #2019 Context: http://build.devdiv.io/2168276 Context: http://build.devdiv.io/2169681 Since 4bb4b2e, our builds have been failing on VSTS on Windows. Jenkins is green, however. Currently getting a failure in `Xamarin.Android.LibraryProjectZip-LibBinding.csproj` such as: 2018-10-31T14:02:28.8336608Z .\gradlew assembleDebug --stacktrace --no-daemon 2018-10-31T14:02:40.7122197Z NDK is missing a "platforms" directory. 2018-10-31T14:02:40.7122937Z If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\dlab14\android-toolchain\sdk\ndk-bundle. 2018-10-31T14:02:40.7124870Z If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning. It doesn't really make sense to me why this started happening with d8/r8 support... The `~\android-toolchain\sdk\ndk-bundle` path seems completely wrong. However, it looks like we should be setting `ANDROID_NDK_HOME=$(AndroidNdkDirectory)`. After that change, we got a new error: 2018-10-31T17:19:30.1558223Z Checking the license for package Android SDK Build-Tools 25.0.2 in C:\Users\dlab14\android-toolchain\sdk\licenses 2018-10-31T17:19:30.1562674Z EXEC : warning : License for package Android SDK Build-Tools 25.0.2 not accepted. [E:\A\_work\14\s\tests\CodeGen-Binding\Xamarin.Android.LibraryProjectZip-LibBinding\Xamarin.Android.LibraryProjectZip-LibBinding.csproj] So this is the actual problem! In fa57aa8, I changed `android-toolchain` to not run `<AcceptAndroidSdkLicense/>` all the time. That was actually making this `.\gradlew` command successfully install Android SDK Build-Tools 25.0.2 and use it without a license prompt. We started seeing the problem since 4bb4b2e, because it caused a new `~\android-toolchain\sdk` directory to get setup. The fix here is to just use Build-Tools 28.0.0, since that is the version we boostrap and install during our build. Other changes: - Added `--stacktrace` to the gradle calls in `r8.targets`, so we get better error messages. It also matches the gradle command in `Xamarin.Android.LibraryProjectZip-LibBinding.csproj`.
1 parent 02c07ed commit b60acfe

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/r8/r8.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<PropertyGroup>
77
<!--NOTE: we don't want a gradle daemon locking directories on Windows-->
8-
<_GradleArgs>--no-daemon</_GradleArgs>
8+
<_GradleArgs>--stacktrace --no-daemon</_GradleArgs>
99
<BuildDependsOn>
1010
ResolveReferences;
1111
_BuildR8;

tests/CodeGen-Binding/Xamarin.Android.LibraryProjectZip-LibBinding/Xamarin.Android.LibraryProjectZip-LibBinding.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<_Jdk9Modules Condition="$(_JdkVersion.StartsWith ('9'))">JAVA_OPTS="--add-modules java.xml.bind"</_Jdk9Modules>
4747
</PropertyGroup>
4848
<Exec
49-
EnvironmentVariables="ANDROID_HOME=$(AndroidSdkDirectory);JAVA_HOME=$(JavaSdkDirectory)"
49+
EnvironmentVariables="ANDROID_HOME=$(AndroidSdkDirectory);ANDROID_NDK_HOME=$(AndroidNdkDirectory);JAVA_HOME=$(JavaSdkDirectory)"
5050
Command="$(_Jdk9Modules) .\gradlew assembleDebug --stacktrace --no-daemon"
5151
WorkingDirectory="$(MSBuildThisFileDirectory)java\JavaLib"
5252
/>

tests/CodeGen-Binding/Xamarin.Android.LibraryProjectZip-LibBinding/java/JavaLib/library/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
22

33
android {
44
compileSdkVersion 25
5-
buildToolsVersion "25.0.2"
5+
buildToolsVersion "28.0.0"
66

77
defaultConfig {
88
minSdkVersion 19

0 commit comments

Comments
 (0)