You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Card Field widget is not shown as expected. The console gives me "lateinit property stripeSdk has not been initialized" but I'm waiting correctly the execution of the WidgetsFlutterBinding.ensureInitialized(), I'm using the FlutterFragmentActivityinstead of the FlutterActivity, I'm initializing the stripePublishableKey and I have followed the setup guide. Idk what to do.
E/flutter (15962): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, lateinit property stripeSdk has not been initialized, null, kotlin.UninitializedPropertyAccessException: lateinit property stripeSdk has not been initialized
E/flutter (15962): at com.flutter.stripe.StripeAndroidPlugin.getStripeSdk(StripeAndroidPlugin.kt:34)
2
E/flutter (15962): at com.flutter.stripe.StripeAndroidPlugin$onAttachedToEngine$1.invoke(StripeAndroidPlugin.kt:59)
E/flutter (15962): at com.flutter.stripe.StripeSdkCardPlatformView.(StripeSdkCardPlatformView.kt:27)
E/flutter (15962): at com.flutter.stripe.StripeSdkCardPlatformViewFactory.create(StripeSdkCardPlatformViewFactory.kt:24)
E/flutter (15962): at io.flutter.plugin.platform.PlatformViewsController.createPlatformView(PlatformViewsController.java:520)
E/flutter (15962): at io.flutter.plugin.platform.PlatformViewsController$1.createForPlatformViewLayer(PlatformViewsController.java:165)
E/flutter (15962): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:105)
E/flutter (15962): at E/flutter (15962): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:55)
E/flutter (15962): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/flutter (15962): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter (15962): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/flutter (15962): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter (15962): at android.os.Handler.handleCallback(Handler.java:942)
E/flutter (15962): at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter (15962): at android.os.Looper.loopOnce(Looper.java:240)
E/flutter (15962): at android.os.Looper.loop(Looper.java:351)
E/flutter (15962): at android.app.ActivityThread.main(ActivityThread.java:8377)
E/flutter (15962): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (15962): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
E/flutter (15962): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
E/flutter (15962): )
E/flutter (15962): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651:7)
E/flutter (15962): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322:18)
E/flutter (15962):
E/flutter (15962): #2 ExpensiveAndroidViewController._sendCreateMessage (package:flutter/src/services/platform_views.dart:1081:5)
E/flutter (15962):
E/flutter (15962): #3 AndroidViewController.create (package:flutter/src/services/platform_views.dart:804:5)
E/flutter (15962):
E/flutter (15962):
flutter doctor -v
[√] Flutter (Channel stable, 3.16.5, on Microsoft Windows [Versione 10.0.22621.3007], locale it-IT)
• Flutter version 3.16.5 on channel stable at E:\programmi\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 78666c8dc5 (3 weeks ago), 2023-12-19 16:14:14 -0800
• Engine revision 3f3e560236
• Dart version 3.2.3
• DevTools version 2.28.4
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Android SDK at E:\programmi\AndroidStudioSdk
• Platform android-34, build-tools 33.0.2
• ANDROID_HOME = C:\Program Files (x86)\Android\android-sdk
• Java binary at: E:\programmi\AndroidStudio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.4)
• Visual Studio at E:\programmi\VisualStudio
• Visual Studio Community 2022 version 17.7.34031.279
• Windows 10 SDK version 10.0.22000.0
[√] Android Studio (version 2022.2)
• Android Studio at E:\programmi\AndroidStudio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = E:\programmi\AndroidStudio
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
[√] Connected device (4 available)
• RMX3521 (mobile) • 7251b54b • android-arm64 • Android 13 (API 33)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Versione 10.0.22621.3007]
• Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.130
• Edge (web) • edge • web-javascript • Microsoft Edge 120.0.2210.121
[√] Network resources
• All expected network resources are available.
• No issues found!
Note: already try to write Stripe.publishableKey = const String.fromEnvironment('STRIPE_PUBLISHABLE_KEY'); under the WidgetsFlutterBinding instead of inside the addPostFrameCallback and it changes nothing
Description
The Card Field widget is not shown as expected. The console gives me "lateinit property stripeSdk has not been initialized" but I'm waiting correctly the execution of the
WidgetsFlutterBinding.ensureInitialized()
, I'm using theFlutterFragmentActivityinstead
of theFlutterActivity
, I'm initializing the stripePublishableKey and I have followed the setup guide. Idk what to do.Sources:
Guide I was following from: https://docs.page/flutter-stripe/flutter_stripe/card_field
Maybe related: #68
Other issue with blank widget: #1383
Flutter
Dependencies
Error log
E/flutter (15962): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, lateinit property stripeSdk has not been initialized, null, kotlin.UninitializedPropertyAccessException: lateinit property stripeSdk has not been initialized
E/flutter (15962): at com.flutter.stripe.StripeAndroidPlugin.getStripeSdk(StripeAndroidPlugin.kt:34)
2
E/flutter (15962): at com.flutter.stripe.StripeAndroidPlugin$onAttachedToEngine$1.invoke(StripeAndroidPlugin.kt:59)
E/flutter (15962): at com.flutter.stripe.StripeSdkCardPlatformView.(StripeSdkCardPlatformView.kt:27)
E/flutter (15962): at com.flutter.stripe.StripeSdkCardPlatformViewFactory.create(StripeSdkCardPlatformViewFactory.kt:24)
E/flutter (15962): at io.flutter.plugin.platform.PlatformViewsController.createPlatformView(PlatformViewsController.java:520)
E/flutter (15962): at io.flutter.plugin.platform.PlatformViewsController$1.createForPlatformViewLayer(PlatformViewsController.java:165)
E/flutter (15962): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:105)
E/flutter (15962): at E/flutter (15962): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:55)
E/flutter (15962): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/flutter (15962): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter (15962): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/flutter (15962): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter (15962): at android.os.Handler.handleCallback(Handler.java:942)
E/flutter (15962): at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter (15962): at android.os.Looper.loopOnce(Looper.java:240)
E/flutter (15962): at android.os.Looper.loop(Looper.java:351)
E/flutter (15962): at android.app.ActivityThread.main(ActivityThread.java:8377)
E/flutter (15962): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (15962): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
E/flutter (15962): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
E/flutter (15962): )
E/flutter (15962): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651:7)
E/flutter (15962): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322:18)
E/flutter (15962):
E/flutter (15962): #2 ExpensiveAndroidViewController._sendCreateMessage (package:flutter/src/services/platform_views.dart:1081:5)
E/flutter (15962):
E/flutter (15962): #3 AndroidViewController.create (package:flutter/src/services/platform_views.dart:804:5)
E/flutter (15962):
E/flutter (15962):
flutter doctor -v
main.dart
MainActivity.tk
I've seen other issues which says to turn off the dark mode, well i don't have the darkmode enabled and the widget still blank:
Bottom Sheet code
The text was updated successfully, but these errors were encountered: