0

I am using the flutter_stripe plugin for stripe payment. It is working on IOS but on android, I am getting this error . As per flutter_stripe documentation all settings done for android and ios..

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not resolve com.stripe:stripe-android:20.1.+. Required by: project :app > project :stripe_android > Failed to list versions for com.stripe:stripe-android. > Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/stripe/stripe-android/maven-metadata.xml. > Could not get resource 'https://google.bintray.com/exoplayer/com/stripe/stripe-android/maven-metadata.xml'. > Could not GET 'https://google.bintray.com/exoplayer/com/stripe/stripe-android/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

  • 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 6m 3s [!] Gradle threw an error while downloading artifacts from the network. Retrying to download...

android/build.gradle

buildscript {
ext.kotlin_version = '1.6.10'
repositories {

    google()
   // mavenCentral()
    jcenter()


}

dependencies {
    classpath 'com.android.tools.build:gradle:4.1.3' //4.1.3
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.3.10'

}

}

allprojects {
repositories {

    google()
    jcenter()
    //mavenCentral()
}

}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}

subprojects {
    project.evaluationDependsOn(':app')
}

Tried jcenter() and mavenCentral().but getting same error

1 Answer 1

0

I forked and fixed it.

  1. Fork flutter_stripe

  2. Replace com.stripe:stripe-android** (flutter_stripe/packages/stripe_android/android/build.gradle)

    Add stripe-android to your build.gradle dependencies.

    dependencies {
        implementation 'com.stripe:stripe-android:20.4.0'
    }
    

    reference

  3. Replace flutter_android with the repository you forked flutter_stripe/packages/stripe/pubspec.yaml

    Like this

     dependencies:
       flutter:
         sdk: flutter
       stripe_android:
         git:
           url: https://github.com/<YourName>/flutter_stripe.git
           ref: <Branch Name>
           path: packages/stripe_android
    

    My Repository

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much. I fixed by changing to implementation 'com.stripe:stripe-android:20.2.2'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.