Skip to content

Commit

Permalink
[tests] InstallAndroidDependenciesTest can use platform-tools 34.…
Browse files Browse the repository at this point in the history
…0.0 (#7800)

We are seeing the `InstallAndroidDependenciesTest` test fail allot
recently. Looking at the logs we see the following warning.

    warning : Dependency `platform-tools` should have been installed but could not be resolved. You can attempt to install it with:
    /Users/dean/Documents/Sandbox/Xamarin/WI1714603/bin/TestRelease/temp/InstallAndroidDependenciesTest/android-sdk/cmdline-tools/7.0/lib/sdkmanager-classpath.jar --install "platform-tools"

As a result `platform-tools` is not installed. This causes the
`ResolveSdks` task to ignore the test sdk directory because `adb` is
missing. So lets update the `AndroidSdkPlatformToolsVersion ` to use
one that does work.
  • Loading branch information
dellis1972 authored and jonpryor committed Mar 9, 2023
1 parent 1fae01a commit fcd72d6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ public void InstallAndroidDependenciesTest ()
Assert.IsTrue (b.Build (proj, parameters: new string [] {
"AcceptAndroidSDKLicenses=true",
"AndroidManifestType=GoogleV2", // Need GoogleV2 so we can install API-32
"AndroidSdkPlatformToolsVersion=33.0.3",
"AndroidSdkPlatformToolsVersion=34.0.0",
}), "InstallAndroidDependencies should have succeeded.");
b.Target = defaultTarget;
b.BuildLogFile = "build.log";
Assert.IsTrue (b.Build (proj, true), "build should have succeeded.");
Assert.IsTrue (b.LastBuildOutput.ContainsText ($"Output Property: _AndroidSdkDirectory={sdkPath}"), "_AndroidSdkDirectory was not set to new SDK path.");
Assert.IsTrue (b.LastBuildOutput.ContainsText ($"JavaPlatformJarPath={sdkPath}"), "JavaPlatformJarPath did not contain new SDK path.");
Assert.IsTrue (b.LastBuildOutput.ContainsText ($"Output Property: _AndroidSdkDirectory={sdkPath}"), $"_AndroidSdkDirectory was not set to new SDK path `{sdkPath}`.");
Assert.IsTrue (b.LastBuildOutput.ContainsText ($"JavaPlatformJarPath={sdkPath}"), $"JavaPlatformJarPath did not contain new SDK path `{sdkPath}`.");
}
} finally {
Environment.SetEnvironmentVariable ("TEST_ANDROID_SDK_PATH", old);
Expand Down

0 comments on commit fcd72d6

Please sign in to comment.