0

我有一个初始功能设置来获取产品并进行购买。它奏效了:我可以进行测试购买。

代码位于“商店”页面中,我决定将 RevenueCat 初始化移动到 main.dart 作为初始入口点。但也许这是错误的,因为它搞砸了一切,并且应用程序在加载时崩溃(下面的错误)。所以我把它放回原来的样子。

该应用程序现在加载并且所有屏幕功能除了我现在打开商店页面时遇到相同的错误。尽管它以前工作过。

*** Assertion failure in +[RCPurchases sharedPurchases](), RCPurchases.m:160
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'There is no singleton instance. Make sure you configure Purchases before trying to get the default instance. More info here: https://errors.rev.cat/configuring-sdk'
*** First throw call stack:
(0x183586754 0x19804d7a8 0x1834883f8 0x1848afa6c 0x1009762f4 0x1009f2d34 0x100cb7bc0 0x100cb5b04 0x10109ea60 0x100dafd7c 0x1010b9070 0x1010531d4 0x1010559fc 0x18350122c 0x183500e28 0x183500278 0x1834fa02c 0x1834f9360 0x19ab37734 0x185f74584 0x185f79df4 0x100906e24 0x1831b5cf8)
libc++abi: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001b169d334 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x1b169d334 <+8>:  b.lo   0x1b169d354               ; <+40>
    0x1b169d338 <+12>: pacibsp
    0x1b169d33c <+16>: stp    x29, x30, [sp, #-0x10]!
    0x1b169d340 <+20>: mov    x29, sp
Target 0: (Runner) stopped.
Lost connection to device.

错误说我应该配置购买...。但我做到了!

    static const revcatapiKey = 'xxxxxxxxxxxxxxxxxxxxxxxx';
    await Purchases.setDebugLogsEnabled(true);
    await Purchases.setup(revcatapiKey,
        appUserId: appUserId, observerMode: false);

我做了flutter cleanflutter pub get。相同的情况:应用程序在打开商店屏幕时构建、加载和崩溃。

我不明白。应用程序现在处于与之前工作时相同的状态。

任何调试或重置建议?帮助!

4

0 回答 0