Switching to Kotlin DSL Unresolved reference when trying to access other file
问题 I have an error when trying to use Kotlin DSL for my gradle files. In build.gradle(app) I have a function to retrieve an api key stored in an file keys.properties , the function in Groovy is the following: // Retrieve key api def getApiKey() { def keysFile = file("keys.properties") def keysProperties = new Properties() keysProperties.load(new FileInputStream(keysFile)) def apiKey = keysProperties['API_KEY'] return apiKey } When switching to Kotlin DSL I naively changed the function as follow: