diff --git a/packages/stripe_android/android/build.gradle b/packages/stripe_android/android/build.gradle index cb87ff3a..5acf7caa 100644 --- a/packages/stripe_android/android/build.gradle +++ b/packages/stripe_android/android/build.gradle @@ -65,3 +65,12 @@ 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 + print("android plugin version: " + androidPluginVersion) + 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") + } +}