Skip to content

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

Closed

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

Activity

  1. liamappelbe commented on May 6, 2026

    @liamappelbe
    Contributor

    We need to check if this is an issue for JNIgen's generated gradle stubs too: pkgs/jnigen/lib/src/tools/android_sdk_tools.dart, _gradleGetClasspathStub and _gradleGetSourcesStub

    Also affects a bunch of examples:

    • pkgs/jni/example/android/app/build.gradle
    • pkgs/jnigen/android_test_runner/android/app/build.gradle
    • pkgs/jnigen/example/in_app_java/android/app/build.gradle
    • pkgs/jnigen/example/kotlin_plugin/android/build.gradle
    • pkgs/jnigen/example/kotlin_plugin/example/android/app/build.gradle
    • pkgs/jnigen/example/maven_libs_groovy/example/android/app/build.gradle
    • pkgs/jnigen/example/notification_plugin/android/build.gradle
    • pkgs/jnigen/example/notification_plugin/example/android/app/build.gradle
    • pkgs/jnigen/example/pdfbox_plugin/android/build.gradle
    • pkgs/jnigen/example/pdfbox_plugin/example/android/app/build.gradle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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