''buildSrc' cannot be used as a project name as it is a reserved name
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.
Solution 1:[1]
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.
Solution 2:[2]
just remove include ':buildSrc' from the settings.gradle file and everything will go well.
Solution 3:[3]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | |
| Solution 3 |

