From 235cbf4028a6414a07283255288ccba63bc4c35e Mon Sep 17 00:00:00 2001 From: "James G. Kim" Date: Sun, 21 Aug 2016 08:52:11 +0900 Subject: [PATCH] Replace `%` with a double-escaped unicode value Resource strings cannot include `%` as-is (cf. http://stackoverflow.com/questions/4414389/android-xml-percent-symbol). --- android/dotenv.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/dotenv.gradle b/android/dotenv.gradle index 39a2afc..94d8d92 100644 --- a/android/dotenv.gradle +++ b/android/dotenv.gradle @@ -16,8 +16,9 @@ readDotEnv() android { defaultConfig { project.env.each { k, v -> + def escaped = v.replaceAll("%","\\\\u0025") buildConfigField "String", k, "\"$v\"" - resValue "string", k, "\"$v\"" + resValue "string", k, "\"$escaped\"" } } }