Skip to content

Commit 2bfd6cb

Browse files
authored
Merge pull request #527 from wura-io/fix/android-google-maps-api-key
fix(android): load Google Maps key from secrets
2 parents 2aaa982 + 054a5a6 commit 2bfd6cb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

android/app/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ if (secretsPropertiesFile.exists()){
2929
secretsProperties.load(new FileInputStream(secretsPropertiesFile))
3030
}
3131

32+
def geoApiKey = secretsProperties.getProperty('GEO_API_KEY')?.trim() ?: project.findProperty('GEO_API_KEY')?.toString()?.trim()
33+
if (!geoApiKey) {
34+
throw GradleException("Google Maps API key is missing. Define GEO_API_KEY in android/secrets.properties or pass -PGEO_API_KEY=<key>.")
35+
}
36+
3237

3338

3439
def isFirebaseDistribution = System.getenv('IS_FIREBASE_DISTRIBUTION') == 'true'
@@ -52,7 +57,7 @@ defaultConfig {
5257
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
5358

5459
manifestPlaceholders = [
55-
GEO_API_KEY: project.findProperty('GEO_API_KEY') ?: "DUMMY",
60+
GEO_API_KEY: geoApiKey,
5661
applicationName: project.findProperty('applicationName') ?: "android.app.Application"
5762
]
5863
}

0 commit comments

Comments
 (0)