@@ -758,6 +758,31 @@ class MainTest extends Specification {
758758 assert results // Asserting existence and contains 1+ entries
759759 }
760760
761+ def ' can disable "Google Services Gradle Plugin" version checks with disableVersionCheck' () {
762+ // com.onesignal:OneSignal:3.15.6' defines a version range of play-services-base@[10.2.1, 16.1.99]
763+ // 17.3.0 is outside of that but this is ok, since enableJetifier is enabled in this case.
764+ // However "Google Services Gradle Plugin" thinks there is a version out of range and fails the build
765+ // We are ensuring this plugin sets disableVersionCheck correctly to disable it
766+ def compileLines = """ \
767+ compile 'com.onesignal:OneSignal:3.15.6'
768+ compile 'com.google.android.gms:play-services-base:17.3.0'
769+ """
770+
771+ when :
772+ def results = runGradleProject([
773+ skipGradleVersion : GRADLE_OLDEST_VERSION ,
774+ ' android.useAndroidX' : true ,
775+ ' android.enableJetifier' : true ,
776+ buildscriptDependencies : " classpath 'com.google.gms:google-services:4.3.4'" ,
777+ applyPlugins : " apply plugin: 'com.google.gms.google-services'" ,
778+ compileLines : compileLines
779+ ])
780+
781+ then :
782+ assertResults(results) {
783+ }
784+ }
785+
761786 def ' firebase 15 - keep mixed minor versions' () {
762787 def compileLines = """ \
763788 compile 'com.google.firebase:firebase-ads:15.0.0'
@@ -778,6 +803,29 @@ class MainTest extends Specification {
778803 }
779804 }
780805
806+ // Same as the test above but handles the afterEvaluate case. See a plugin that does this below
807+ // https://github.com/dpa99c/cordova-plugin-firebasex/blob/11.0.3/src/android/build.gradle#L43
808+ def ' can disable "Google Services Gradle Plugin" version checks with disableVersionCheck - even if added in afterEvaluate' () {
809+ def compileLines = """ \
810+ compile 'com.onesignal:OneSignal:3.15.6'
811+ compile 'com.google.android.gms:play-services-base:17.3.0'
812+ """
813+
814+ when :
815+ def results = runGradleProject([
816+ skipGradleVersion : GRADLE_OLDEST_VERSION ,
817+ ' android.useAndroidX' : true ,
818+ ' android.enableJetifier' : true ,
819+ buildscriptDependencies : " classpath 'com.google.gms:google-services:4.3.4'" ,
820+ applyPlugins : " afterEvaluate { apply plugin: 'com.google.gms.google-services' }" ,
821+ compileLines : compileLines,
822+ ])
823+
824+ then :
825+ assertResults(results) {
826+ }
827+ }
828+
781829 def ' gms 15 - Support for 12 and 15 version' () {
782830 def compileLines = """ \
783831 compile 'com.google.android.gms:play-services-gcm:12.0.1'
0 commit comments