Could not get unknown property in Android

Hi Community,

I want to use Bitrise for my Android application, but I have the following error:

* What went wrong:

A problem occurred evaluating project ':app'.

> Could not get unknown property 'MOVIE_DB_API_KEY' for object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.

I declared it in my app.gradle:

buildTypes.each {
        it.buildConfigField 'String', 'MOVIE_DB_API_KEY', MOVIE_DB_API_KEY
    }

Where MOVIE_DB_API_KEY is declared in my gradle.properties file.

However, for security reasons, I didn’t load this key, so I added as a Secret Environment Variables, but apparently that didn’t work :confused:

Environment variables are not magically converted to Gradle properties. You need to do it explicitly.
For example you can add -PMOVIE_DB_API_KEY:${MOVIE_DB_API_KEY} Gradle parameter.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.