Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'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.

enter image description here

like image 935
Magesh Pandian Avatar asked Apr 15 '20 09:04

Magesh Pandian


Video Answer


1 Answers

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:

  1. Open your settings.gradle / settings.gradle.kts
  2. Remove "buildSrc" from included modules
  3. 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.

like image 178
HBB20 Avatar answered Sep 20 '22 04:09

HBB20