Skip to content

Commit 24d16d0

Browse files
committed
Fixed build errors about a missing android/key.properties file.
See: flutter/website#1536
1 parent 614e469 commit 24d16d0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

android/app/build.gradle

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ if (flutterRoot == null) {
1414
apply plugin: 'com.android.application'
1515
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
1616

17-
def keystorePropertiesFile = rootProject.file("key.properties")
1817
def keystoreProperties = new Properties()
19-
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
18+
def keystorePropertiesFile = rootProject.file('key.properties')
19+
if (keystorePropertiesFile.exists()) {
20+
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
21+
}
2022

2123
android {
2224
compileSdkVersion 27
@@ -39,7 +41,7 @@ android {
3941
release {
4042
keyAlias keystoreProperties['keyAlias']
4143
keyPassword keystoreProperties['keyPassword']
42-
storeFile file(keystoreProperties['storeFile'])
44+
storeFile keystoreProperties.containsKey('storeFile') ? file(keystoreProperties['storeFile']) : null
4345
storePassword keystoreProperties['storePassword']
4446
}
4547
}

0 commit comments

Comments
 (0)