文档

Unity Engine

Unity Engine

AndroidExternalToolsSettings.Gradle

Contains properties to modify Android Gradle specific values.
阅读时间1 分钟最后更新于 1 个月前

Definition

public class AndroidExternalToolsSettings.Gradle

Examples

using UnityEngine; using UnityEditor;using UnityEditor.Android;public class AndroidGradleSettingsSample{ [MenuItem("Tools/Set Android Gradle settings")] public static void SetAndroidGradleSettings() { // Retrieve the current version of the Android Gradle Plugin (AGP) string currentVersion = AndroidExternalToolsSettings.Gradle.androidGradlePluginVersion; // Log the currently configured version Debug.Log($"Current Android Gradle Plugin Version: {currentVersion}"); // Set a custom path for the Gradle installation. // Replace this with the actual path. AndroidExternalToolsSettings.Gradle.path = "/path/to/your/gradle"; Debug.Log($"Gradle Path set to: {AndroidExternalToolsSettings.Gradle.path}"); }}

Static Properties

Property

Description

androidGradlePluginVersionVersion of the Android Gradle Plugin (AGP) used for building Android applications.
pathPath to the Gradle used for building Android applications.
stopDaemonsOnExitStops Gradle daemons when the Unity Editor exits.
userHomePathPath to the Gradle User Home directory.
versionVersion of Gradle used for building Android applications.