hrtval
Jan 22, 2024

--

Actually there were few issues on android part in my case too.
According to the official Stripe flutter’s package documentation, you have to do the following:
1. Check in app/build.gradle that your API level is more than 21. I’m using compileSdkVersion 34, minSdkVersion 22 and targetSdkVersion 33.
2. Check Kotlin version in android/build.gradle. I’m using the following: ext.kotlin_version = '1.8.21'.
3. Replace your android/app/src/main/res/values/styles.xml with following: https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/app/src/main/res/values/styles.xml.
4. Update your gradle to 7.6.1 version. Here is my settings.gradle:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip

5. Replace your android/app/src/main/kotlin/com/example/appname/MainActivity.kt with following:

package com.your.bundle-id

import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity: FlutterFragmentActivity() {
}

Hope this will help

--

--

hrtval
hrtval

Written by hrtval

Flutter developer, CEO at operator18.ru, senior security officer

No responses yet