Unverified Commit e262817a authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

Fix the gradle templates so that they default to values rather than throw...

Fix the gradle templates so that they default to values rather than throw build exceptions. (#19916)

When creating a new project, the build fails with an error similar to:

"versionCode not found. Define flutter.versionCode in the local.properties file."

This puts developers in the untenable situation of having to edit a file with local paths, but being unable to check it in.

This changes the templates to default to using versionCode 1 and version "1.0" if they are not defined in the local.properties file.

Fixes #18983.
parent a4cc34de
......@@ -13,12 +13,12 @@ if (flutterRoot == null) {
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
throw new GradleException("versionCode not found. Define flutter.versionCode in the local.properties file.")
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
throw new GradleException("versionName not found. Define flutter.versionName in the local.properties file.")
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
......
......@@ -13,12 +13,12 @@ if (flutterRoot == null) {
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
throw new GradleException("versionCode not found. Define flutter.versionCode in the local.properties file.")
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
throw new GradleException("versionName not found. Define flutter.versionName in the local.properties file.")
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
......
......@@ -15,12 +15,12 @@ if (flutterRoot == null) {
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
throw new GradleException("versionCode not found. Define flutter.versionCode in the local.properties file.")
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
throw new GradleException("versionName not found. Define flutter.versionName in the local.properties file.")
flutterVersionName = '1.0'
}
apply plugin: 'com.android.library'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment