Skip to main content

Added this packages:

purchases_flutter: ^8.1.6purchases_ui_flutter: ^8.1.6

 

Error:

 Purchases instance already set with the same configuration. Ignoring duplicate call.
D/DPurchases] - DEBUG(21300): ℹ️ Listener set
E/PurchasesUIFlutter(21300): Paywalls require your activity to subclass FlutterFragmentActivity
I/flutter (21300): ----------------FIREBASE CRASHLYTICS----------------
I/flutter (21300): PlatformException(0, Make sure your MainActivity inherits from FlutterFragmentActivity, null, null)
I/flutter (21300): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648:7)
I/flutter (21300): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)
I/flutter (21300): <asynchronous suspension>
I/flutter (21300): #2      RevenueCatUI.presentPaywallIfNeeded (package:purchases_ui_flutter/purchases_ui_flutter.dart:41:20)
I/flutter (21300): <asynchronous suspension>
I/flutter (21300): #3      _configureSDK (package:english_booster/main.dart:79:5)
I/flutter (21300): <asynchronous suspension>
I/flutter (21300): #4      main (package:english_booster/main.dart:67:3)
I/flutter (21300): <asynchronous suspension>

 

main.dart code:

Future<void> _configureSDK() async {  await Purchases.setLogLevel(LogLevel.debug);  PurchasesConfiguration? configuration;  if (Platform.isAndroid) {    configuration = PurchasesConfiguration(googleApiKey);  }  if(configuration !=null) {    await Purchases.configure(configuration);    await RevenueCatUI.presentPaywallIfNeeded(entitlementID);  }}

 

Tested api level: 33, 35. But didn’t working. 

Hi @md-mafujul-islam-809ce9,

I see this message at the very top of your logs: `Purchases instance already set with the same configuration. Ignoring duplicate call.`

This indicates that you’re configuring the SDK twice, which can cause a variety of issues. If the code snippet that you shared is the second time you’re configuring an instance of Purchases, it does look like it is being ignored.

My recommendation would be to check that you only configure the SDK once, and to move `presentPaywallIfNeeded` out of your configuration block. We have some code samples for presenting your Flutter Paywall here: https://www.revenuecat.com/docs/tools/paywalls/displaying-paywalls#flutter


Reply