Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Didn't find class "com.stripe.android.paymentsheet" #2054

Closed
panchalAlpit opened this issue Jan 29, 2025 · 2 comments
Closed

Didn't find class "com.stripe.android.paymentsheet" #2054

panchalAlpit opened this issue Jan 29, 2025 · 2 comments
Labels
Awaiting response Awaiting response from the issuer

Comments

@panchalAlpit
Copy link

panchalAlpit commented Jan 29, 2025

Hello Stripe,

I didn't understand the issue. i have done all the step for implement the payment.

`Future<void> openPaymentSheet() async {
     try {
      Map<String, dynamic> paymentIntentData = await callPaymentIntentApi('200', 'USD');
     print(paymentIntentData);
    UpPrint(name: "CheckSecretKey", value: paymentIntentData['client_secret'].toString());

    var gPay = const PaymentSheetGooglePay(merchantCountryCode: "US",
    currencyCode: "USD",
    testEnv: true);

  await Stripe.instance
      .initPaymentSheet(
      paymentSheetParameters:  SetupPaymentSheetParameters(
        paymentIntentClientSecret: paymentIntentData['client_secret'],
        googlePay: gPay,
        style: ThemeMode.system,
        merchantDisplayName: 'UpSeeks',
      ))
      .then((value) {
    showPaymentSheet();
  });
   } catch (e, s) {
   print('Exception:$e$s');
  }
}

     Future callPaymentIntentApi(String amount, String currency) async {
   try {
    Map<String, dynamic> body = {
       'amount': calculateAmount(amount),
      'currency': currency,
    };
  print(body);
  var response = await http.post(
      Uri.parse('https://api.stripe.com/v1/payment_intents'),
      body: body,
      headers: {
        'Authorization': 'Bearer ${UpConfigure.secretKey}',
        'Content-Type': 'application/x-www-form-urlencoded'
      });
  return jsonDecode(response.body);
} catch (err) {
  print('callPaymentIntentApi Exception: ${err.toString()}');
   }
 }

`

E/AndroidRuntime( 1947): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/stripe/android/paymentsheet/PaymentSheet$GooglePayConfiguration$ButtonType;

E/AndroidRuntime( 1947): at com.reactnativestripesdk.PaymentSheetFragment.(PaymentSheetFragment.kt:360)
E/AndroidRuntime( 1947): at com.reactnativestripesdk.StripeSdkModule.initPaymentSheet(StripeSdkModule.kt:167)
E/AndroidRuntime( 1947): at com.flutter.stripe.StripeAndroidPlugin.onMethodCall(StripeAndroidPlugin.kt:137)
E/AndroidRuntime( 1947): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/AndroidRuntime( 1947): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
E/AndroidRuntime( 1947): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/AndroidRuntime( 1947): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/AndroidRuntime( 1947): at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime( 1947): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1947): at android.os.Looper.loop(Looper.java:246)
E/AndroidRuntime( 1947): at android.app.ActivityThread.main(ActivityThread.java:8633)
E/AndroidRuntime( 1947): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 1947): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
E/AndroidRuntime( 1947): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

E/AndroidRuntime( 1947): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.stripe.android.paymentsheet.PaymentSheet$GooglePayConfiguration$ButtonType" on path: DexPathList[[zip file "/data/app/~~omCwG-Jv1eXw7tTzA8ie7A==/com.app.upseeks-yPDfrp6VY8jSnCRszDurxQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~omCwG-Jv1eXw7tTzA8ie7A==/com.app.upseeks-yPDfrp6VY8jSnCRszDurxQ==/lib/arm64, /data/app/~~omCwG-Jv1eXw7tTzA8ie7A==/com.app.upseeks-yPDfrp6VY8jSnCRszDurxQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/system_ext/lib64]]
E/AndroidRuntime( 1947): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)

E/AndroidRuntime( 1947): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime( 1947): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime( 1947): ... 14 more
I/Process ( 1947): Sending signal. PID: 1947 SIG: 9

**Manifest file code

 `.        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW"/>
           <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="flutterstripe" android:host="safepay" />
          </intent-filter>`

I have done all step but didn't get the proper issue for what I miss the thing?

Note: It's only getting the issue in Android Device but in IOS it's working fine

Thanks in advance

@pamzak
Copy link

pamzak commented Feb 2, 2025

i already have some problome

@remonh87
Copy link
Member

remonh87 commented Feb 5, 2025

can you check that you use the correct android version v 11.4.0 in pubspec.yaml?

@remonh87 remonh87 added the Awaiting response Awaiting response from the issuer label Feb 5, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Awaiting response Awaiting response from the issuer
Projects
None yet
Development

No branches or pull requests

3 participants