From 34ed1279d830bf6f4e69eebf72f4ae9c32299711 Mon Sep 17 00:00:00 2001 From: Andrew Watson Date: Mon, 16 Oct 2023 14:24:24 -0700 Subject: [PATCH] Fix local properties file issue --- examples/example-clientlib-ktx-app/app/build.gradle | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/example-clientlib-ktx-app/app/build.gradle b/examples/example-clientlib-ktx-app/app/build.gradle index b71b28f90..972cbf266 100644 --- a/examples/example-clientlib-ktx-app/app/build.gradle +++ b/examples/example-clientlib-ktx-app/app/build.gradle @@ -21,9 +21,14 @@ android { } Properties properties = new Properties() - properties.load(project.rootProject.file("local.properties").newDataInputStream()) + def propertiesFile = project.rootProject.file('local.properties') + if (propertiesFile.exists()) { + properties.load(propertiesFile.newDataInputStream()) - buildConfigField "String", "HELIUS_KEY", "\"${properties.getProperty("HELIUS_KEY")}\"" + buildConfigField "String", "HELIUS_KEY", "\"${properties.getProperty("HELIUS_KEY")}\"" + } else { + buildConfigField "String", "HELIUS_KEY", "\"\"" + } } buildTypes {