Skip to content

Sync triggers Gradle deprecation warning due to IDE injecting  Project  object via Tooling API (Gradle 9.6.1) #316

Description

@Examecc

Description

When syncing any Android project on RV2IDE with Gradle 9.6.1, the following deprecation warning is emitted during the Configure project :app phase:

Using a Project object as a dependency notation has been deprecated.

This will fail with an error in Gradle 10.

Please use project(String) or createProjectDependency(String).

Investigation & Root Cause

Through reverse engineering (smali analysis), I traced the source of this warning. It is not caused by the project's build.gradle.kts nor the Gradle core itself.

The issue originates from the IDE's internal model building logic:

  1. During the Gradle Tooling API sync phase, RV2IDE constructs a dependency list for the module.
  2. Inside ModuleGradleConfigBuilder.addDependency(Object), the IDE passes an instance of org.gradle.api.Project directly into the dependency handler.
  3. Gradle 9.x correctly identifies this legacy usage and emits the deprecation warning before the dependency is even resolved (evidenced by Forced resolution of 0 dependencies).

Why this is critical

  • This warning is not a false positive; it indicates an incorrect internal API usage within the IDE.
  • Since the object is passed during the Configure phase, it cannot be suppressed by standard Gradle properties or smali patches targeting the Writer classes alone.
  • This will become a hard error in Gradle 10, breaking all RV2IDE projects using Gradle 9+.

Suggested Fix

In ModuleGradleConfigBuilder, please replace the direct passing of the Project object with a string-based notation (e.g., "project(':app')") or use the official DependencyFactory.createProjectDependency() API provided by Gradle.

Environment

  • RV2IDE Version: 1.0.0+gh.r04(1025)
  • Gradle Version: 9.6.1
  • AGP Version: 9.2.1
  • Android SDK: 36

Thanks for the amazing tool! Looking forward to the fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions