Skip to content

[Enhancement proposal]: build.gradle properties syntax in Groovy has been deprecated #1484

@flfa

Description

@flfa

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Windows

Proposal

When building a new Flutter project which uses flutter-permission-handler there are warnings like this:
Image

These warnings are caused by the change in gradle's Groovy syntax. Please see the new syntax: Groovy "space assignment" syntax

The solution in my case was to manually edit the build.gradle from /home/user_name/.pub-cache/hosted/pub.dev/permission_handler_android-13.0.1/android/build.gradle and fill the missing "=". See below:

group = 'com.baseflow.permissionhandler'
version = '1.0'

buildscript {
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:8.0.2'
    }
}

rootProject.allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

apply plugin: 'com.android.library'

android {
    // Conditional for compatibility with AGP <4.2.
    if (project.android.hasProperty("namespace")) {
      namespace = 'com.baseflow.permissionhandler'
    }
    compileSdkVersion = 35

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }

    defaultConfig {
        minSdkVersion = 19
    }
}

Pitch

The issue is not critical but it would be nice not to have useless warnings when building a project.

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