Gradle warns about space assignment in a Groovy build.gradle file
Your error
Properties should be assigned using the 'propName = value' syntax. Setting a property via the Gradle-generated 'propName value' or 'propName(value)' syntax in Groovy DSL has been deprecated. This is scheduled to be removed in Gradle 10. Use assignment ('group = <value>') instead.1 more line it can showFix it fast
Most common cause, 1 of 3Your own build.gradle uses space assignment
Add an equals sign.
plugins { id 'java' }
group = 'com.example'
version = '1.0'
java {
sourceCompatibility = JavaVersion.VERSION_17
}Short answer
Gradle 8.12 deprecated the Groovy shorthand that sets a property without an equals sign, such as group 'com.example' or namespace "app.id". It still works, but Gradle 10 removes it. Run the build with --warning-mode all --stacktrace to get the file and line, then write propertyName = value there. Warnings from a library's build.gradle are fixed by updating that library.
Which cause do you have?
Show every deprecation with a stack trace. The trace contains build.gradle:<line> for each warning, which tells you whether the line is yours or a dependency's.
./gradlew help --warning-mode all --stacktrace 2>&1 | grep -E "build.gradle:[0-9]+"Then find the line you see in this list and open its fix:
- 1Your own build.gradle uses space assignment
The stack trace points at a build.gradle inside your project, for example build.gradle:2 - 2Many files need the same change
Dozens of modules repeat the same property names - 3The line belongs to a dependency's build script
The path in the trace is under node_modules, the Flutter pub cache or another plugin folder
What does the error look like?
Properties should be assigned using the 'propName = value' syntax. Setting a property via the Gradle-generated 'propName value' or 'propName(value)' syntax in Groovy DSL has been deprecated. This is scheduled to be removed in Gradle 10. Use assignment ('group = <value>') instead.Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.
Cause 1 of 3
Your own build.gradle uses space assignment
You seeThe stack trace points at a build.gradle inside your project, for example build.gradle:2
Check
Gradle's upgrade guide lists five ways Groovy scripts set a property and says the last one, propertyName value, is a Gradle extension, not Groovy. Lines such as group 'x', version '1.0', namespace 'id' or sourceCompatibility JavaVersion.VERSION_17 use it.
grep -nE "^\s*(group|version|namespace|compileSdk|minSdk|targetSdk|sourceCompatibility|targetCompatibility) [^=]" build.gradle */build.gradleFix
Add an equals sign. Method calls that take several arguments keep parentheses instead, for example jvmArgs("a", "b").
plugins { id 'java' }
group = 'com.example'
version = '1.0'
java {
sourceCompatibility = JavaVersion.VERSION_17
}Verify
Run with --warning-mode fail; the build passes, so no deprecation is left in the scripts it evaluated.
./gradlew help --warning-mode failConfirmed by docs.gradle.org
Cause 2 of 3
Many files need the same change
You seeDozens of modules repeat the same property names
Check
The upgrade guide gives a find and sed command for bulk edits. It takes the property names you list and inserts the equals sign after them.
find . -name 'build.gradle' -not -path '*/node_modules/*' | wc -lFix
Run the documented command with the property names you saw in the warnings, then review the diff before committing. It keeps a .bak copy of each file.
find . -name 'build.gradle' -type f -exec sed -i.bak -E \
's/([^A-Za-z]|^)(group|version|namespace)[ \t]*([^= \t{])/\1\2 = \3/g' {} +
git diff --statVerify
The warning count drops to zero and the build output is unchanged.
./gradlew build --warning-mode all 2>&1 | grep -c "propName = value"Confirmed by docs.gradle.org
Cause 3 of 3
The line belongs to a dependency's build script
You seeThe path in the trace is under node_modules, the Flutter pub cache or another plugin folder
Check
React Native, Expo and Flutter apps compile their native plugins with those plugins' own build.gradle files. Edits there are overwritten on the next install.
./gradlew help --warning-mode all --stacktrace 2>&1 | grep -E 'node_modules|pub-cache' | sort -uFix
Update the plugin to a release that uses assignment syntax. If none exists yet, leave it: it is a warning until Gradle 10, so you can still build on Gradle 8.12 to 9.x while the maintainer catches up.
npm outdated
# or, in Flutter
flutter pub outdatedVerify
After the update the trace no longer lists that plugin's file.
./gradlew help --warning-mode all --stacktrace 2>&1 | grep -cE 'node_modules|pub-cache'Confirmed by docs.gradle.org
How do I stop it coming back?
- Run CI with --warning-mode fail on your own modules so new space assignments are caught in review.
- Write new Groovy scripts with = everywhere, or use the Kotlin DSL, which only allows assignment.
- Read the Gradle upgrade guide before each major Gradle update.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies: