My flutter_stripe error #2212
              
                Unanswered
              
          
                  
                    
                      apokaliptolesamale
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 1 comment
-
| You should activate custom payments in stripe itself. I would recommend contacting stripe support here as this is outside our library. | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am very new development integration using flutter and Stripe. I saw some tutorial and they work. I apply the same step by step and when I going to compile usin ./gradlew build the console return the error:
Lint found 1 errors, 13 warnings. First failure:
../Android/SDK/.pub-cache/hosted/pub.dev/stripe_android-12.0.1/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetFragment.kt:446: Error: CustomPaymentMethod can only be accessed from within the same library group (referenced groupId=com.stripe from groupId=com.flutter.stripe) [RestrictedApi]
customPaymentMethod: PaymentSheet.CustomPaymentMethod,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Explanation for issues of type "RestrictedApi":
This API has been flagged with a restriction that has not been met.
Examples of API restrictions:
Gradle library group id)
You can add your own API restrictions with the @RestrictTo annotation.
I don know why!
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23") // Kotlin 1.9.23 (última estable)
classpath("com.android.tools.build:gradle:8.5.0") // AGP 8.4.0 (última estable)
//classpath("com.google.gms:google-services:4.4.0") // <-- ¡Añade esta línea! (Usa la última versión si lo deseas)
}
}
allprojects {
repositories {
}
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
rootProject.layout.buildDirectory.value(newBuildDir)
subprojects {
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
project.layout.buildDirectory.value(newSubprojectBuildDir)
}
subprojects {
project.evaluationDependsOn(":app")
}
tasks.register("clean") {
delete(rootProject.layout.buildDirectory)
}
tasks.withType {
enabled = false
}
pluginManagement {
val flutterSdkPath = run {
val properties = java.util.Properties()
file("local.properties").inputStream().use { properties.load(it) }
val flutterSdkPath = properties.getProperty("flutter.sdk")
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
flutterSdkPath
}
}
plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "8.7.3" apply false // Actualizado a 8.3.0
id("org.jetbrains.kotlin.android") version "2.1.0" apply false // Kotlin 1.9.23
}
include(":app")
import java.util.Properties
import java.io.FileInputStream
plugins {
id("com.android.application")
id("kotlin-android")
id("dev.flutter.flutter-gradle-plugin")
}
android {
namespace = "myid"
compileSdk = 35
ndkVersion = "29.0.13846066"
}
dependencies {
implementation("com.google.android.material:material:1.12.0")
//implementation("com.stripe:stripe-android:12.0.1") // Reemplaza VERSION con la última versión
//implementation("io.flutter:flutter_embedding_debug:1.0.0")
//implementation("io.flutter:flutter_embedding_release:1.0.0-fac0f5d3ac4aba57529696ea9699a46b16315f5f")
}
flutter {
source = "../.."
}
Archivo vacío para evitar advertencias
-dontwarn
Flutter
-keep class io.flutter.app.** { ; }
-keep class io.flutter.plugin.* { ; }
-keep class io.flutter.util.* { ; }
-keep class io.flutter.view.* { ; }
-keep class io.flutter.* { ; }
-keep class io.flutter.plugins.* { *; }
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivity$g
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Args
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Error
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningEphemeralKeyProvider
Keep Stripe classes
-keep class com.stripe.** { *; }
Beta Was this translation helpful? Give feedback.
All reactions