I just installed flutter_stripe in my flutter project and did all the android requirements in the package page https://pub.dev/packages/flutter_stripe
right after that I started getting this error :
<code>FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':stripe_android:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 27s
┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin. │
│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then │
│ update C:Users21627StudioProjectswashwiseandroidbuild.gradle: │
│ ext.kotlin_version = '<latest-version>' │
└────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1
</code>
<code>FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':stripe_android:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 27s
┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin. │
│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then │
│ update C:Users21627StudioProjectswashwiseandroidbuild.gradle: │
│ ext.kotlin_version = '<latest-version>' │
└────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1
</code>
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':stripe_android:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 27s
┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin. │
│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then │
│ update C:Users21627StudioProjectswashwiseandroidbuild.gradle: │
│ ext.kotlin_version = '<latest-version>' │
└────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1
Along with alot of lookalike error messages that look like this :
<code>Class 'com.stripe.android.model.CardBrand' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from C:/Users/21627/.gradle/caches/transforms-3/89e9d582b3d60c8bb4032a940e43df92/transformed/jetified-payments-model-20.37.4-api.jar!/com/stripe/android/model/CardBrand.class
</code>
<code>Class 'com.stripe.android.model.CardBrand' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from C:/Users/21627/.gradle/caches/transforms-3/89e9d582b3d60c8bb4032a940e43df92/transformed/jetified-payments-model-20.37.4-api.jar!/com/stripe/android/model/CardBrand.class
</code>
Class 'com.stripe.android.model.CardBrand' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from C:/Users/21627/.gradle/caches/transforms-3/89e9d582b3d60c8bb4032a940e43df92/transformed/jetified-payments-model-20.37.4-api.jar!/com/stripe/android/model/CardBrand.class
I tried updating kotlin version to the latest the way it suggested but that didn’t work. tried with kotlin 2.0.0 and some other new versions and it didn’t work.
tried running flutter clean
and rebuilding but it still didn’t work