From 22b62ae2ebe584d4871b6658ac6aa2e5095334d0 Mon Sep 17 00:00:00 2001 From: Jonas Bark Date: Sat, 28 Sep 2024 11:41:44 +0200 Subject: [PATCH] throw warning when incompatible com.android.application plugin is used see https://github.com/flutter-stripe/flutter_stripe/issues/1909 --- packages/stripe_android/android/build.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/stripe_android/android/build.gradle b/packages/stripe_android/android/build.gradle index cb87ff3a..0ce4460f 100644 --- a/packages/stripe_android/android/build.gradle +++ b/packages/stripe_android/android/build.gradle @@ -65,3 +65,11 @@ dependencies { // Users need to declare this dependency on their own, otherwise all methods are a no-op compileOnly 'com.stripe:stripe-android-issuing-push-provisioning:1.1.0' } + +afterEvaluate { + // check version of com.android.application - fail if 8.0.0 or higher + def androidPluginVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION + if (androidPluginVersion >= '8.0.0') { + throw new GradleException("flutter_stripe: Stripe Android SDK requires com.android.application plugin lower than 8.0.0.\nSee https://github.com/flutter-stripe/flutter_stripe/issues/1909\n") + } +}