Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit b1710f0

Browse files
author
SD MacBookAir 1
committed
feat(Android): Add Conditional Errors for whether or not user wants to use firestore.
update the error message to guide the user to fix the problem.
1 parent bfb95cf commit b1710f0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

publish/scripts/installer.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,15 @@ repositories {
463463
def supportVersion = project.hasProperty("supportVersion") ? project.supportVersion : "26.0.0"
464464
def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : "12.0.1"
465465
466+
` + (isSelected(result.firestore) ? `
467+
if ( VersionNumber.parse( googlePlayServicesVersion ) < VersionNumber.parse( '11.4.2' ) ) {
468+
throw new GradleException(" googlePlayServicesVersion set too low, as you want to use firestore please update to at least 11.4.2 ( currently set to $googlePlayServicesVersion )");
469+
}
470+
` : `
466471
if ( VersionNumber.parse( googlePlayServicesVersion ) < VersionNumber.parse( '9.2' ) ) {
467-
throw new GradleException('Google Play services version too low, please update to at least 9.2');
472+
throw new GradleException("googlePlayServicesVersion set too low, please update to at least '9.2' ( currently set to $googlePlayServicesVersion )");
468473
}
474+
`) + `
469475
470476
dependencies {
471477
compile "com.android.support:appcompat-v7:$supportVersion"
@@ -474,8 +480,6 @@ dependencies {
474480
compile "com.android.support:design:$supportVersion"
475481
compile "com.android.support:support-compat:$supportVersion"
476482
477-
478-
479483
// make sure you have these versions by updating your local Android SDK's (Android Support repo and Google repo)
480484
compile "com.google.firebase:firebase-core:$googlePlayServicesVersion"
481485
compile "com.google.firebase:firebase-auth:$googlePlayServicesVersion"

0 commit comments

Comments
 (0)