Skip to content

Update jni Android Gradle scripts to avoid Groovy space-assignment deprecations #3347

@ancient0328

Description

@ancient0328

The Android Gradle scripts for pkgs/jni and pkgs/jni_flutter currently use Groovy space-assignment / generated setter syntax in several places, for example:

pkgs/jni/android/build.gradle:

  • group 'com.github.dart_lang.jni'
  • version '1.0'
  • namespace 'com.github.dart_lang.jni'
  • compileSdk 35
  • ndkVersion flutter.ndkVersion
  • minSdk 21

pkgs/jni_flutter/android/build.gradle:

  • group 'com.github.dart_lang.jni_flutter'
  • version '1.0'
  • namespace 'com.github.dart_lang.jni_flutter'
  • compileSdk 35
  • minSdk 21

With recent Gradle versions, these forms emit deprecation warnings. Gradle's upgrade guide states that generated property setter methods for Groovy space-assignment syntax are deprecated and will be removed in Gradle 10, and recommends explicit assignment such as propertyName = value.

A minimal remediation should be limited to Android Gradle files and should not alter Dart, Java, Kotlin, native runtime, public API, or package dependency semantics.

Reference: https://docs.gradle.org/current/userguide/upgrading_version_8.html#groovy_space_assignment_syntax

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions