Closed Aptul9 closed 8 months ago
I would run flutter clean and pod update first. Looks like some old version of the ios sdk is lingering somewhere
@remonh87 I've done both, and both went well without errors, but the assertion above keeps failing and crashing the application, are you able to have it working on the latest version of flutter stripe?
I have the same problem since I installed the update for my MAC. Someone found a solution ?
I have found a similar issue in the React Native library, but nothing really useful for this issue: https://github.com/stripe/stripe-react-native/issues/341
@remonh87 We are encountering the same issue as well. Everything went well and then this bug occured all of a sudden.
How do you fix it? I am experiencing the same issue right now
Heres I fixed this issue.. Though my project is react native
pod deintegrate
pod install
I've don exactly what you suggested, but the error is still here.
Heres I fixed this issue.. Though my project is react native
- Clean your build folder
- run
pod deintegrate
- run
pod install
I do everything, including clearing cache, but I don't know why this happens. Android is working fine; I ran an iOS example of Flutter Stripe and encountered the same error. Basically, any additional configurations that also causing issues. I only used the payment secret key in the payment sheet using the payment intent.
`
final response = await http.post(
Uri.parse('https://api.stripe.com/v1/payment_intents'),
body: {
'amount': (totalAmount * 100).convertString,
"currency": 'usd',
},
headers: _getHeader());
EasyLoadingHelper.dismissLoader();
final jsonResponse = jsonDecode(response.body);
print(jsonResponse.toString());
print(jsonResponse['paymentIntent']);
// 2. Initialize the payment sheet
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
paymentIntentClientSecret: jsonResponse['client_secret'],
merchantDisplayName: 'Somos',
),
);
await Stripe.instance.presentPaymentSheet();
EasyLoadingHelper.showSuccessDialog('Payment is Successful');
return jsonResponse['paymentIntentId'];
static Map<String, String> _getHeader() { return { 'Authorization': 'Bearer $secretKey', 'Content-Type': 'application/x-www-form-urlencoded' }; }
await PaymentController.initPayment(
context: context, applicationFreePercent: 3 * 100, totalAmount: 30);
`
This is my code. Could you kindly guide me if there are any issues on my side?
I've not been able to solve this after one month, and it seems I'm not the only one with, I'm starting to worry if we will ever get a response
I identified the issue with the older machine, but upon switching to the M1 MacBook, I successfully resolved the encountered error message.
@abdullahjavaid409 how did you solve the error? I also have an M1 MacBook.
here's the step-by-step process:
Open your terminal and run the following command to clear the CocoaPods cache: Copy code pod cache clean --all This command will clean the CocoaPods cache for all pods.
After cleaning the CocoaPods cache, run the following command to clean your Flutter project: Copy code flutter clean This command will delete the build folder and any other generated files in your Flutter project.
Finally, open your Xcode project and ensure that the deployment target for your main target (Runner) is set to iOS 13 or higher:
Open your project in Xcode. In the project navigator, select the Runner project. In the "General" tab, find the "Deployment Info" section. Set the "iOS Deployment Target" to 13.0 or higher. Once you've completed these steps, your Flutter project should be clean and ready to run with the correct deployment target set in Xcode.
After upgrading everything, including flutter, version, ruby, flutter_stripe version, etc, the problem can be marked as solved
@Aptul9 Have you solved it here? I've tried all the answers above but still doesn't work. I keep getting this crash and I don't know what to do.
@Aptul9 Hello, I am installing version 9.5.0. Due to some other dependencies in the project, I am unable to upgrade to the latest version 10.1.1. How can I solve this problem? Is there only one way to upgrade?
After upgrading everything, including flutter, version, ruby, flutter_stripe version, etc, the problem can be marked as solved
I did all of this and it still doesnt work. https://github.com/flutter-stripe/flutter_stripe/issues/1765
Hi, @Aptul9
So did you solve this issue?
I am using 9.5.0 version and error is apple_pay_mark, not icon_x_standalone.
Describe the bug When creating the payment sheet on iOS (on Android it works fine), I'm getting this error, then the App crashes:
StripeUICore/ImageMaker.swift:51: Assertion failed: Failed to find an image named icon_x_standalone
To Reproduce Steps to reproduce the behavior:
This is my Flutter-side code: ` static Future initPaymentSheet(String tableId, int number) async {
try {
// 1. create payment intent on the server
final data = await EdgeFunctions.createTestPaymentSheet(tableId, number);
}
static Future<Map<String, dynamic>> createTestPaymentSheet(String tableId, int number) async { final res = await supabaseClient.functions.invoke('payment-sheet', body: {"tableId": tableId, "number": number}); return res.data as Map<String, dynamic>; }`
And this is my return from my server-side code:
const res = { stripe_pk: Deno.env.get("STRIPE_PUBLISHABLE_KEY"), paymentIntent: paymentIntent.client_secret, ephemeralKey: ephemeralKey.secret, customer: customer, }; return new Response(JSON.stringify(res), { headers: { "Content-Type": "application/json" }, status: 200, });
As Said, this works fine on Android.
Expected behavior The payment sheet should open normally, like it does on Android.
Smartphone / tablet
Additional context Add any other context about the problem here.