PlatformException(flutter_stripe initialization failed, The plugin failed to initialize. Are you using FlutterFragmentActivity? #537
Replies: 38 comments 13 replies
-
Do you get a stacktrace in the logcat output? Maybe 2 other things to check:
<meta-data
android:name="flutterEmbedding"
android:value="2" /> |
Beta Was this translation helpful? Give feedback.
-
@remonh87 I have migrated flutter version
|
Beta Was this translation helpful? Give feedback.
-
I too have this issue. |
Beta Was this translation helpful? Give feedback.
-
Does this happen to you on the example app from this repository as well? |
Beta Was this translation helpful? Give feedback.
-
So when I created an app from scratch and plugged everything in as an example to show you it worked fine and created the transaction in the stripe log, sigh. So there is something within my main app that is causing this. Will continue investigating. [√] Flutter (Channel stable, 2.2.2, on Microsoft Windows [Version 10.0.19043.1052], locale en-GB) [√] Android toolchain - develop for Android devices (Android SDK version 30.0.1) [√] Chrome - develop for the web [√] Android Studio (version 4.1.0) [√] VS Code (version 1.57.1) [√] Connected device (3 available) • No issues found! |
Beta Was this translation helpful? Give feedback.
-
I managed to reproduce the error android:name=".MainActivity" (This is the default when you create a new project) unfortunately it instantly crashes at runtime when i try to change my one to .MainActivity so no luck there |
Beta Was this translation helpful? Give feedback.
-
as the error states your MainActivity class must extend from FlutterFragmentActivity. In the github project link you shared it still extended from FlutterActivity. |
Beta Was this translation helpful? Give feedback.
-
Hi yea sorry I deleted that comment after I realised my mistake.That example worked when I changed that FlutterFragmentActivity |
Beta Was this translation helpful? Give feedback.
-
Hi I am getting same error but I have changed that in FlutterFragmentActivity. Please see the bellow I have given everything what I have implemented. Technology: Flutter 2.2.2 Error, I faced : So far I have already tried, Changes done on MainActivity.kt File package io.talkeng.app.global App level build.gradle applicationId "io.talkeng.app.global" Root level build.gradle buildscript { Android Manifest File:
Main.dart file: WidgetsFlutterBinding.ensureInitialized(); Stripe.publishableKey = API calling code : Testkey(Secret key) ; sk_test_51IlUalSG0anJNv68S2XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX const functions = require("firebase-functions"); Calling Url : https://us-central1-talkengserverinstance.cloudfunctions.net/stripePayment FlutterFragmentActivity Future makePayment() async {
} I called this function from button click: onPressed: () async { |
Beta Was this translation helpful? Give feedback.
-
@subhra9326 |
Beta Was this translation helpful? Give feedback.
-
Hi, @jonasbark can you tell me the step to do that. I don't understand what to do. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Good day, I have solved my issue by editing my AndroidManifest.xml
I found the solution here since it was crashing on runtime flutter/flutter#47136 |
Beta Was this translation helpful? Give feedback.
-
Hi, @JoyEnergiser and @jonasbark, thanks for helping me, My problem is resolved. Again thanks a lot. |
Beta Was this translation helpful? Give feedback.
-
Hi,not work for me, do you have another solution? AndroidManifest.xml MainActivity.kt styles.xml ERROR : |
Beta Was this translation helpful? Give feedback.
-
I am also having the same issue I followed the above instructions but the issue prevails. Below is my manifest file:
|
Beta Was this translation helpful? Give feedback.
-
I guess so... now i have another error but i think its not related with the package. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I tried writting that, it doesn´t show any errors but also it doesn´t show any google pay button in my case. |
Beta Was this translation helpful? Give feedback.
-
that would be another configuration issue, unrelated to this topic. Be sure to check out official stripe documentation around Google Pay + Payment Sheet which you're using I guess. |
Beta Was this translation helpful? Give feedback.
-
hey @remonh87 thanks a lot my issue is fixed |
Beta Was this translation helpful? Give feedback.
-
I had this issue too and was able to fix once I realized I needed to add My app, decarbon, had the file for both: |
Beta Was this translation helpful? Give feedback.
-
Anyone got the solution ? |
Beta Was this translation helpful? Give feedback.
-
For me, it solve when I upgrade to the latest flutter version i.e 2.8.1 |
Beta Was this translation helpful? Give feedback.
-
Anyone got the solution ??? I/flutter ( 6424): exeptionPlatformException(flutter_stripe initialization failed, The plugin failed to initialize: |
Beta Was this translation helpful? Give feedback.
-
I did everything as mentioned above but i'm still having the issue. MainActivity.kt
AndroidManifest.xml
How do i get over this problem now?? |
Beta Was this translation helpful? Give feedback.
-
i solve by remove the android:theme="@style/LaunchTheme" and replase it with android:theme="@style/Theme.AppCompat" and it work with me |
Beta Was this translation helpful? Give feedback.
-
i have the issue of platform exception while lauching stripe. |
Beta Was this translation helpful? Give feedback.
-
package com.example.sporton import io.flutter.embedding.android.FlutterActivity class MainActivity: FlutterFragmentActivity() { |
Beta Was this translation helpful? Give feedback.
-
please help anybody..... |
Beta Was this translation helpful? Give feedback.
-
I am trying to set up a payment using this plugin but can't able to initialize it. I followed the setup instruction for android but facing this issue.
Initialization
android/app/src/main/kotlin/com/example/myapp/MainActivity.kt
build.gradle
Smartphone / tablet
Is there any other implementation that I have missed?
Beta Was this translation helpful? Give feedback.
All reactions