Ejemplo n.º 1
0
        /// <summary>
        /// Checks the latest version of Android SDK Build-Tools that is installed, prompting to upgrade if necessary.
        /// Returns true if the latest version of Android SDK Build-Tools supports the "aapt2 convert" command,
        /// and false otherwise.
        /// </summary>
        public static bool CheckConvert()
        {
            var newestBuildToolsVersion = AndroidBuildTools.GetNewestBuildToolsVersion();

            if (newestBuildToolsVersion == null)
            {
                PlayInstantBuilder.DisplayBuildError(string.Format("Failed to locate {0}", BuildToolsDisplayName));
                return(false);
            }

            if (AndroidBuildTools.IsBuildToolsVersionAtLeast(newestBuildToolsVersion, BuildToolsMinimumVersion))
            {
                return(true);
            }

            var message = string.Format(
                "App Bundle creation requires {0} version {1} or later.\n\nClick \"OK\" to install {0} version {2}.",
                BuildToolsDisplayName, BuildToolsMinimumVersion, BuildToolsLatestVersion);

            if (PlayInstantBuilder.DisplayBuildErrorDialog(message))
            {
                AndroidSdkPackageInstaller.InstallPackage(BuildToolsPackageName, BuildToolsDisplayName);
            }

            return(false);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Performs installation or upgrade of the Google Play Instant Development SDK.
 /// </summary>
 public static void InstallPlayInstantSdk()
 {
     AndroidSdkPackageInstaller.InstallPackage(InstantAppsSdkPackageName, InstantAppsSdkDisplayName);
 }