After I upgrade my gradle gradle-5.4.1 to gradle-6.3, I got an error like 'buildSrc' cannot be used as a project name as it is a reserved name. I'm using buidleSrc for Gradle Dependency Management(link). I dont know how to solve this issue please help on this.
tldr: Remove "buildSrc" from settings.gradle
/ settings.gradle.kts
. With gradle update, "buildSrc" is now reserved project name.
If you are looking an answer for Android, this should be helpful:
- Open your
settings.gradle
/settings.gradle.kts
- Remove "buildSrc" from included modules
- Rebuild
Example:
settings.gradle.kts
might look like this (syntax will be different for settings.gradle
)
include(":app")
rootProject.name = "yourapp"
include(":moduleA")
include(":buildSrc")
include(":moduleB")
include(":moduleC")
remove the line that includes "buildSrc" like:
include(":app")
rootProject.name = "yourapp"
include(":moduleA")
include(":moduleB")
include(":moduleC")
and rebuild project.
just remove include ':buildSrc' from the settings.gradle file and everything will go well.
This is a change introduced in Gradle 6.0 that made buildSrc
a reserved project name.
It means you have a reference to buildSrc
as a project in your settings.gradle(.kts)
.
The reference will look like:
include("buildSrc")
includeBuild("buildSrc")
I would recommend to start by removing that reference and see if it fixes the issue. If not, it means your project was wired differently and you simply have to rename it.
This is mentioned in #2 of the answer from HBB20, but I didn't catch it my first few times: Also remove references to buildSrc from all your modules, for example this line:
implementation(project(":buildSrc"))
© 2022 - 2024 — McMap. All rights reserved.
kmm
setup fromkampkit
for keeping my dependencies separate and clean. And started getting this erorr. Now it is fine, and all links work perfectly after module is removed as aninclude
module dependency. – Lactometer