Skip to content

Fix Gradle-path API guard: use UNITY_6000_2_OR_NEWER (Gradle.path was added in 6000.2, not 6000.0)#219

Merged
sierpinskid merged 1 commit into
GetStream:developfrom
harlan:harlan/gradle-path-6000_2-guard
Jul 2, 2026
Merged

Fix Gradle-path API guard: use UNITY_6000_2_OR_NEWER (Gradle.path was added in 6000.2, not 6000.0)#219
sierpinskid merged 1 commit into
GetStream:developfrom
harlan:harlan/gradle-path-6000_2-guard

Conversation

@harlan

@harlan harlan commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Problem

StreamEditorTools guards its Android Gradle-path access with #if UNITY_6000_0_OR_NEWER and calls AndroidExternalToolsSettings.Gradle.path. However, the nested Gradle grouping (Gradle.path / Gradle.userHomePath) was only introduced in Unity 6000.2. On 6000.0.x and 6000.1.x, AndroidExternalToolsSettings exposes only the flat gradlePath string property, so the editor tools fail to compile there:

StreamEditorTools.cs(60,61): error CS0117: 'AndroidExternalToolsSettings' does not contain a definition for 'Gradle'

This breaks the package on any 6000.0 / 6000.1 LTS project (e.g. Unity 6000.0.71f1).

Fix

Change the guard boundary in both #if blocks from UNITY_6000_0_OR_NEWER to UNITY_6000_2_OR_NEWER:

  • 6000.0 / 6000.1 → flat AndroidExternalToolsSettings.gradlePath (not deprecated on these versions)
  • 6000.2+ → nested AndroidExternalToolsSettings.Gradle.path (on 6000.2 gradlePath is [Obsolete], so this also avoids the deprecation warning)

References

…_OR_NEWER

StreamEditorTools guards its Android Gradle-path access with
UNITY_6000_0_OR_NEWER and calls AndroidExternalToolsSettings.Gradle.path. But
the nested Gradle grouping (Gradle.path / Gradle.userHomePath) was only
introduced in Unity 6000.2. On 6000.0.x and 6000.1.x, AndroidExternalToolsSettings
exposes only the flat gradlePath property, so the editor tools fail to compile:

  StreamEditorTools.cs(60,61): error CS0117: 'AndroidExternalToolsSettings'
  does not contain a definition for 'Gradle'

Move the boundary to UNITY_6000_2_OR_NEWER so:
  * 6000.0 / 6000.1 -> flat AndroidExternalToolsSettings.gradlePath
  * 6000.2+         -> nested AndroidExternalToolsSettings.Gradle.path
                       (gradlePath is [Obsolete] there; Gradle.path avoids the warning)
@sierpinskid sierpinskid self-requested a review July 2, 2026 08:56
@sierpinskid

Copy link
Copy Markdown
Member

All tests passed:
image

@sierpinskid sierpinskid merged commit 14ca23e into GetStream:develop Jul 2, 2026
0 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants