'build.gradle file does not find a property from the gradle.properties file
In my build.gradle file, I have a reference to a property that is in the gradle.properties file:
credentials {
username "$USERNAME"
password "$PASSWORD"
}
And in the gradle.properties file:
USERNAME=BLAH
PASSWORD=BLAHBLAH
In Intellij, I have an error:
A problem occurred evaluating root project 'my-Project'. Could not get unknown property 'USERNAME' for Credentials [username: null] of type org.gradle.internal.credentials.DefaultPasswordCredentials_Decorated.
I doubled check the name of the property + restarted the computer + invalidated the cache in the Intellj, but nothing seems to help
Solution 1:[1]
So after looking in the Intellij's
File -> Setttings -> Build Execution -> Build Tools -> Gradle -> "Gradle User Home"
I realized the Intellij is looking at another gradle.properties file:
C:\Users\<user-X>\.gradle <-- I was focusing on this folder
C:\Users\<user-Y>\.gradle <-- while Intellij was looking at that folder
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 | riorio |
