Gradle - How do I share an API key set up with the Secrets plugin to CI?

Viewed 114

I set up Google Maps for Android according to the documentation

I have an API key in my local.properties file. The Secrets Gradle plugin is set up and copying MAPS_API_KEY to a generated file called BuildConfig.

I have CI set up using Bitbucket Pipelines, which is now failing because it doesn't have access to the maps api key. I get the following error when it tries to build:

/opt/atlassian/pipelines/agent/build/app/src/main/AndroidManifest.xml:40:13-44 Error:
    Attribute meta-data#com.google.android.geo.API_KEY@value at AndroidManifest.xml:40:13-44 requires a placeholder substitution but no value for <MAPS_API_KEY> is provided.

I tried setting up the MAPS_API_KEY as a repository value in Pipelines but that didn't change anything. Is there a "correct" automatic way to share this key? If not, how can I manually set it up in my Continuous Integration system?

0 Answers
Related