Skip to content

[Xcode 27] Multiple in_app_purchase_storekit tests fail with Xcode 27 #195494

Open
flutter/packages
#13410

Description

@vashworth

https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac_arm64%20ios_platform_tests_shard_3%20master/10/overview

 Test Case '-[RunnerTests.InAppPurchase2PluginTests testDiscountedProductSuccess]' started.
 2026-10-28 08:27:40.786251-0700 Runner[32343:191363] [Default] Could not find a UI anchor for consumable_discounted purchase. UI may behave incorrectly.
 2026-10-28 08:27:40.787392-0700 Runner[32343:191442] [Default] Could not get confirmation scene ID for consumable_discounted purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:299: error: -[RunnerTests.InAppPurchase2PluginTests testDiscountedProductSuccess] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "Purchase request should succeed".
 Test Case '-[RunnerTests.InAppPurchase2PluginTests testDiscountedProductSuccess]' failed (60.297 seconds).

Test Case '-[RunnerTests.InAppPurchase2PluginTests testDiscountedSubscriptionSuccess]' started.
 2026-10-28 08:28:41.060808-0700 Runner[32343:191363] [Default] Could not find a UI anchor for subscription_discounted purchase. UI may behave incorrectly.
 2026-10-28 08:28:41.061886-0700 Runner[32343:191450] [Default] Could not get confirmation scene ID for subscription_discounted purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:285: error: -[RunnerTests.InAppPurchase2PluginTests testDiscountedSubscriptionSuccess] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "Purchase request should succeed".
 Test Case '-[RunnerTests.InAppPurchase2PluginTests testDiscountedSubscriptionSuccess]' failed (60.021 seconds).

Test Case '-[RunnerTests.InAppPurchase2PluginTests testDuplicatePurchaseFails]' started.
 2026-10-28 08:29:41.090324-0700 Runner[32343:191363] [Default] Could not find a UI anchor for consumable purchase. UI may behave incorrectly.
 2026-10-28 08:29:41.092255-0700 Runner[32343:192311] [Default] Could not get confirmation scene ID for consumable purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:698: error: -[RunnerTests.InAppPurchase2PluginTests testDuplicatePurchaseFails] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "First purchase should succeed".
 2026-10-28 08:30:41.111447-0700 Runner[32343:191363] [Default] Could not find a UI anchor for consumable purchase. UI may behave incorrectly.
 2026-10-28 08:30:41.113309-0700 Runner[32343:192312] [Default] Could not get confirmation scene ID for consumable purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:713: error: -[RunnerTests.InAppPurchase2PluginTests testDuplicatePurchaseFails] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "Second purchase should fail".
 Test Case '-[RunnerTests.InAppPurchase2PluginTests testDuplicatePurchaseFails]' failed (180.032 seconds).

 Test Case '-[RunnerTests.InAppPurchase2PluginTests testFailedProductUnavilablePurchase]' started.
 2026-10-28 08:32:41.126337-0700 Runner[32343:191363] [Default] Could not find a UI anchor for consumable purchase. UI may behave incorrectly.
 2026-10-28 08:32:41.128085-0700 Runner[32343:191452] [Default] Could not get confirmation scene ID for consumable purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:239: error: -[RunnerTests.InAppPurchase2PluginTests testFailedProductUnavilablePurchase] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "Purchase request should succeed".
 Test Case '-[RunnerTests.InAppPurchase2PluginTests testFailedProductUnavilablePurchase]' failed (60.031 seconds).

 Test Case '-[RunnerTests.InAppPurchase2PluginTests testFinishTransactionSucceedsWhenAlreadyFinished]' started.
 2026-10-28 08:33:41.153678-0700 Runner[32343:191363] [Default] Could not find a UI anchor for consumable purchase. UI may behave incorrectly.
 2026-10-28 08:33:41.155562-0700 Runner[32343:191454] [Default] Could not get confirmation scene ID for consumable purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:551: error: -[RunnerTests.InAppPurchase2PluginTests testFinishTransactionSucceedsWhenAlreadyFinished] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "Purchase should succeed".
 Test Case '-[RunnerTests.InAppPurchase2PluginTests testFinishTransactionSucceedsWhenAlreadyFinished]' failed (60.049 seconds).

 Test Case '-[RunnerTests.InAppPurchase2PluginTests testFinishTransaction]' started.
 2026-10-28 08:34:41.199833-0700 Runner[32343:191363] [Default] Could not find a UI anchor for consumable purchase. UI may behave incorrectly.
 2026-10-28 08:34:41.201232-0700 Runner[32343:194200] [Default] Could not get confirmation scene ID for consumable purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:513: error: -[RunnerTests.InAppPurchase2PluginTests testFinishTransaction] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "Purchase should succeed".
 Test Case '-[RunnerTests.InAppPurchase2PluginTests testFinishTransaction]' failed (60.049 seconds).


 Test Case '-[RunnerTests.InAppPurchase2PluginTests testIsWinBackOfferEligibleEligible]' started.
 2026-10-28 08:37:07.439554-0700 Runner[32647:196280] [Default] Could not find a UI anchor for subscription_silver purchase. UI may behave incorrectly.
 2026-10-28 08:37:07.440512-0700 Runner[32647:196362] [Default] Could not get confirmation scene ID for subscription_silver purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:604: error: -[RunnerTests.InAppPurchase2PluginTests testIsWinBackOfferEligibleEligible] : XCTAssertTrue failed
 Test Case '-[RunnerTests.InAppPurchase2PluginTests testIsWinBackOfferEligibleEligible]' failed (0.123 seconds).

 Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseWithIntroductoryOfferEligibilityJWS]' started.
 2026-10-28 08:37:07.636668-0700 Runner[32647:196280] [Default] Could not find a UI anchor for subscription_silver purchase. UI may behave incorrectly.
 2026-10-28 08:37:07.638149-0700 Runner[32647:196359] [Default] Could not get confirmation scene ID for subscription_silver purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:389: error: -[RunnerTests.InAppPurchase2PluginTests testPurchaseWithIntroductoryOfferEligibilityJWS] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "Purchase with an introductory offer eligibility JWS should complete".
 Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseWithIntroductoryOfferEligibilityJWS]' failed (60.018 seconds).

 Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseWithPromotionalOffer]' started.
 2026-10-28 08:38:07.664979-0700 Runner[32647:196280] [Default] Could not find a UI anchor for consumable purchase. UI may behave incorrectly.
 2026-10-28 08:38:07.666847-0700 Runner[32647:197100] [Default] Could not get confirmation scene ID for consumable purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:348: error: -[RunnerTests.InAppPurchase2PluginTests testPurchaseWithPromotionalOffer] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "Purchase with promotionalOffer should succeed".
 Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseWithPromotionalOffer]' failed (60.027 seconds).

Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseWithWinBackOffer]' started.
 2026-10-28 08:39:07.681662-0700 Runner[32647:196280] [Default] Could not find a UI anchor for subscription_silver purchase. UI may behave incorrectly.
 2026-10-28 08:39:07.682658-0700 Runner[32647:196351] [Default] Could not get confirmation scene ID for subscription_silver purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:369: error: -[RunnerTests.InAppPurchase2PluginTests testPurchaseWithWinBackOffer] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "Purchase with winBackOffer should succeed".
 Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseWithWinBackOffer]' failed (60.020 seconds).

 Test Case '-[RunnerTests.InAppPurchase2PluginTests testRestoreMultipleProductsEmitsSingleBatchedUpdate]' started.
 2026-10-28 08:40:07.726401-0700 Runner[32647:196280] [Default] Could not find a UI anchor for subscription_discounted purchase. UI may behave incorrectly.
 2026-10-28 08:40:07.727988-0700 Runner[32647:196353] [Default] Could not get confirmation scene ID for subscription_discounted purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:453: error: -[RunnerTests.InAppPurchase2PluginTests testRestoreMultipleProductsEmitsSingleBatchedUpdate] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "First purchase should succeed", "First purchase transaction update should be received".
 2026-10-28 08:42:07.744249-0700 Runner[32647:196280] [Default] Could not find a UI anchor for subscription_silver purchase. UI may behave incorrectly.
 2026-10-28 08:42:07.746303-0700 Runner[32647:197100] [Default] Could not get confirmation scene ID for subscription_silver purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:470: error: -[RunnerTests.InAppPurchase2PluginTests testRestoreMultipleProductsEmitsSingleBatchedUpdate] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "Second purchase should succeed", "Second purchase transaction update should be received".
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:492: error: -[RunnerTests.InAppPurchase2PluginTests testRestoreMultipleProductsEmitsSingleBatchedUpdate] : XCTAssertEqual failed: ("0") is not equal to ("2")
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:494: error: -[RunnerTests.InAppPurchase2PluginTests testRestoreMultipleProductsEmitsSingleBatchedUpdate] : XCTAssertEqual failed: ("[]") is not equal to ("["subscription_silver", "subscription_discounted"]")
 Test Case '-[RunnerTests.InAppPurchase2PluginTests testRestoreMultipleProductsEmitsSingleBatchedUpdate]' failed (180.044 seconds).

Test Case '-[RunnerTests.InAppPurchase2PluginTests testRestoreProductSuccess]' started.
 2026-10-28 08:43:07.767049-0700 Runner[32647:196280] [Default] Could not find a UI anchor for subscription_silver purchase. UI may behave incorrectly.
 2026-10-28 08:43:07.768361-0700 Runner[32647:196351] [Default] Could not get confirmation scene ID for subscription_silver purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:411: error: -[RunnerTests.InAppPurchase2PluginTests testRestoreProductSuccess] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "Purchase request should succeed", "Purchase transaction update should be received".
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:414: error: -[RunnerTests.InAppPurchase2PluginTests testRestoreProductSuccess] : XCTAssertTrue failed
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:431: error: -[RunnerTests.InAppPurchase2PluginTests testRestoreProductSuccess] : XCTAssertTrue failed
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:432: error: -[RunnerTests.InAppPurchase2PluginTests testRestoreProductSuccess] : XCTAssertTrue failed
 Test Case '-[RunnerTests.InAppPurchase2PluginTests testRestoreProductSuccess]' failed (60.036 seconds).

 Test Case '-[RunnerTests.InAppPurchase2PluginTests testSuccessfulPurchase]' started.
 2026-10-28 08:44:07.817440-0700 Runner[32647:196280] [Default] Could not find a UI anchor for consumable purchase. UI may behave incorrectly.
 2026-10-28 08:44:07.818797-0700 Runner[32647:196353] [Default] Could not get confirmation scene ID for consumable purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:221: error: -[RunnerTests.InAppPurchase2PluginTests testSuccessfulPurchase] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "Purchase request should succeed".
 Test Case '-[RunnerTests.InAppPurchase2PluginTests testSuccessfulPurchase]' failed (60.016 seconds).

The test also appears to crash at one point:

 Test Case '-[RunnerTests.InAppPurchase2PluginTests testGetTransactionJsonRepresentation]' started.
 2026-10-28 08:35:41.340156-0700 Runner[32343:191363] [Default] Could not find a UI anchor for consumable purchase. UI may behave incorrectly.
 2026-10-28 08:35:41.341080-0700 Runner[32343:195231] [Default] Could not get confirmation scene ID for consumable purchase. UI may behave incorrectly.
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:193: error: -[RunnerTests.InAppPurchase2PluginTests testGetTransactionJsonRepresentation] : Asynchronous wait failed: Exceeded timeout of 60 seconds, with unfulfilled expectations: "Purchase request should succeed".
 /Volumes/Work/s/w/ir/x/w/packages/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift:196: error: -[RunnerTests.InAppPurchase2PluginTests testGetTransactionJsonRepresentation] : *** -[__NSArray0 objectAtIndex:]: index 0 beyond bounds for empty array (NSRangeException)
 2026-10-28 08:36:41.468532-0700 Runner[32343:195231] [Default] Flushing outgoing messages to the IDE with timeout 30.00s
 2026-10-28 08:36:41.469197-0700 Runner[32343:191454] [Default] Received confirmation that IDE processed remaining outgoing messages
 2026-10-28 08:36:41.476407-0700 Runner[32343:195231] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArray0 objectAtIndex:]: index 0 beyond bounds for empty array'
 *** First throw call stack:
 (
 	0   CoreFoundation                      0x00000001c0287f24 __exceptionPreprocess + 172
 	1   libobjc.A.dylib                     0x00000001c008194c objc_exception_throw + 72
 	2   CoreFoundation                      0x00000001c014b290 -[__NSArray0 objectEnumerator] + 0
 	3   libswiftCore.dylib                  0x00000001c16a8cd4 $ss12_ArrayBufferV19_getElementSlowPathyyXlSiF + 128
 	4   libswiftCore.dylib                  0x00000001c16ad6f4 $sSayxSicig + 168
 	5   RunnerTests                         0x0000000105efda10 $s11RunnerTests020InAppPurchase2PluginB0C36testGetTransactionJsonRepresentationyyYaKFTY2_ + 532
 	6   RunnerTests                         0x0000000105efe57d $s11RunnerTests020InAppPurchase2PluginB0C36testGetTransactionJsonRepresentationyyYaKFyyYacfU_ToTQ0_ + 1
 	7   RunnerTests                         0x0000000105efe751 $s11R
 *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArray0 objectAtIndex:]: index 0 beyond bounds for empty array'
 *** First throw call stack:
 (
 	0   CoreFoundation                      0x00000001c0287f24 __exceptionPreprocess + 172
 	1   libobjc.A.dylib                     0x00000001c008194c objc_exception_throw + 72
 	2   CoreFoundation                      0x00000001c014b290 -[__NSArray0 objectEnumerator] + 0
 	3   libswiftCore.dylib                  0x00000001c16a8cd4 $ss12_ArrayBufferV19_getElementSlowPathyyXlSiF + 128
 	4   libswiftCore.dylib                  0x00000001c16ad6f4 $sSayxSicig + 168
 	5   RunnerTests                         0x0000000105efda10 $s11RunnerTests020InAppPurchase2PluginB0C36testGetTransactionJsonRepresentationyyYaKFTY2_ + 532
 	6   RunnerTests                         0x0000000105efe57d $s11RunnerTests020InAppPurchase2PluginB0C36testGetTransactionJsonRepresentationyyYaKFyyYacfU_ToTQ0_ + 1
 	7   RunnerTests                         0x0000000105efe751 $s11RunnerTests020InAppPurchase2PluginB0C36testGetTransactionJsonRepresentationyyYaKFyyYacfU_ToTATQ0_ + 1
 	8   RunnerTests                         0x0000000105ed8471 $sIeghH_IeAgH_TRTQ0_ + 1
 	9   RunnerTests                         0x0000000105ed9869 $sIeghH_IeAgH_TRTATQ0_ + 1
 	10  RunnerTests                         0x0000000105ed8541 $sIeAgH_ytIeAgHr_TRTQ0_ + 1
 	11  RunnerTests                         0x0000000105ed99c1 $sIeAgH_ytIeAgHr_TRTATQ0_ + 1
 	12  RunnerTests                         0x0000000105ed8a05 $sxIeAgHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tgq5TQ0_ + 1
 	13  RunnerTests                         0x0000000105ed9af9 $sxIeAgHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tgq5TATQ0_ + 1
 	14  libswift_Concurrency.dylib          0x00000001c15650e9 _ZL23completeTaskWithClosurePN5swift12AsyncContextEPNS_10SwiftErrorE + 1
 )
 libc++abi: terminating due to uncaught exception of type NSException
 2026-10-28 08:37:06.611726-0700 Runner[32647:196280] [UIFocus] FlutterView implements focusItemsInRect: - caching for linear focus movement is limited as long as this view is on screen.
 2026-10-28 08:37:06.683562-0700 Runner[32647:196280] [IMPORTANT:flutter/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.mm(45)] Using the Impeller rendering backend (Metal).
 2026-10-28 08:37:06.716657-0700 Runner[32647:196377] flutter: The Dart VM service is listening on http://127.0.0.1:50426/FiJMTqLBihQ=/
 2026-10-28 08:37:06.851524-0700 Runner[32647:196280] [XPCErrors] non-launching port is incompatible with service identifier "com.apple.PointerUI.pointeruid.default-service"
 2026-10-28 08:37:07.250122-0700 Runner[32647:196280] [UIFocus] FlutterSemanticsScrollView implements focusItemsInRect: - caching for linear focus movement is limited as long as this view is on screen.
 Restarting after unexpected exit, crash, or test timeout; summary will include totals from previous launches.

Also unhandled exceptions:

2026-10-28 08:27:38.385019-0700 Runner[32343:191363] [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel: "dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.startListeningToTransactions"., null, null)
 #0      _extractReplyValueOrThrow (package:in_app_purchase_storekit/src/sk2_pigeon.g.dart:21:5)
 #1      InAppPurchase2API.startListeningToTransactions (package:in_app_purchase_storekit/src/sk2_pigeon.g.dart:1098:5)
 <asynchronous suspension>
 2026-10-28 08:27:38.385777-0700 Runner[32343:191363] [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel: "dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.registerPaymentQueueDelegate"., null, null)
 #0      _extractReplyValueOrThrow (package:in_app_purchase_storekit/src/messages.g.dart:21:5)
 #1      InAppPurchaseAPI.registerPaymentQueueDelegate (package:in_app_purchase_storekit/src/messages.g.dart:1115:5)
 <asynchronous suspension>
 #2      SKPaymentQueueWrapper.setDelegate (package:in_app_purchase_storekit/src/store_kit_wrappers/sk_payment_queue_wrapper.dart:106:7)
 <asynchronous suspension>
 2026-10-28 08:27:38.385963-0700 Runner[32343:191363] [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel: "dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.canMakePayments"., null, null)
 #0      _extractReplyValueOrThrow (package:in_app_purchase_storekit/src/sk2_pigeon.g.dart:21:5)
 #1      InAppPurchase2API.canMakePayments (package:in_app_purchase_storekit/src/sk2_pigeon.g.dart:945:42)
 <asynchronous suspension>
 #2      _MyAppState.initStoreInfo (package:in_app_purchase_storekit_example/main.dart:78:30)
 <asynchronous suspension>

Activity

  1. added
    packageflutter/packages repository. See also p: labels.
    P1High-priority issues at the top of the work list
    team-iosOwned by iOS platform team
    triaged-iosTriaged by iOS platform team
    on Oct 28, 2026
  2. LouiseHsu commented on Oct 28, 2026

    @LouiseHsu
    Contributor

    I think this isnt a test flake. This seems to be the same issue as #194373

  3. vashworth commented on Nov 9, 2026

    @vashworth
    ContributorAuthor

    @LouiseHsu These tests are still failing unfortunately. I was able to recreate the failures locally. Use the following:

    cd packages/in_app_purchase/in_app_purchase_storekit/example
    flutter build ios --config-only
    xcrun simctl create "Flutter-iPhone" "com.apple.CoreSimulator.SimDeviceType.iPhone-14" "com.apple.CoreSimulator.SimRuntime.iOS-26-2"  | xargs xcrun simctl boot
    xcrun xcodebuild clean test -workspace ios/Runner.xcworkspace -scheme Runner -configuration Debug -destination "platform=iOS Simulator,name=Flutter-iPhone,OS=27.0" GCC_TREAT_WARNINGS_AS_ERRORS=YES
    
  4. LouiseHsu commented on Nov 10, 2026

    @LouiseHsu
    Contributor

    @LouiseHsu These tests are still failing unfortunately. I was able to recreate the failures locally. Use the following:

    cd packages/in_app_purchase/in_app_purchase_storekit/example
    flutter build ios --config-only
    xcrun simctl create "Flutter-iPhone" "com.apple.CoreSimulator.SimDeviceType.iPhone-14" "com.apple.CoreSimulator.SimRuntime.iOS-26-2"  | xargs xcrun simctl boot
    xcrun xcodebuild clean test -workspace ios/Runner.xcworkspace -scheme Runner -configuration Debug -destination "platform=iOS Simulator,name=Flutter-iPhone,OS=27.0" GCC_TREAT_WARNINGS_AS_ERRORS=YES
    

    noooo wtf. let me look into this

    I literally cant repro

        Command line invocation:
            /Applications/Xcode-beta.app/Contents/Developer/usr/bin/xcodebuild test-without-building \
              -workspace /Users/louisehsu/Development/packages/packages/in_app_purchase/in_app_purchase_storekit/example/ios/Runner.xcworkspace \
              -scheme Runner \
              -configuration Debug \
              -destination "platform=iOS Simulator,id=EA156B2D-6393-4CCD-BE56-6EA1DCCAB695" \
              FLUTTER_PREBUILT_ENGINE_VERSION=3e875ebe3aa720bb8f567ed8080a2554c16238ac \
              GCC_TREAT_WARNINGS_AS_ERRORS=YES
        ...
        Test Suite 'InAppPurchase2PluginTests' started at 2026-11-09 19:06:07.893.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testCanMakePayments]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testCanMakePayments]' passed (0.682 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testDiscountedProductSuccess]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testDiscountedProductSuccess]' passed (0.104 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testDiscountedSubscriptionSuccess]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testDiscountedSubscriptionSuccess]' passed (0.055 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testDuplicatePurchaseFails]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testDuplicatePurchaseFails]' passed (0.052 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testFailedProductUnavilablePurchase]' started.
        .../InAppPurchaseStoreKit2PluginTests.swift:72: -[RunnerTests.InAppPurchase2PluginTests testFailedProductUnavilablePurchase] : Test skipped - Failed purchases hang on the iOS 27 simulator (Apple known issue 184255116).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testFailedProductUnavilablePurchase]' skipped (0.021 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testFinishTransactionSucceedsWhenAlreadyFinished]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testFinishTransactionSucceedsWhenAlreadyFinished]' passed (0.059 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testFinishTransaction]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testFinishTransaction]' passed (0.046 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testGetDiscountedProducts]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testGetDiscountedProducts]' passed (0.120 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testGetInvalidProducts]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testGetInvalidProducts]' passed (0.014 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testGetProducts]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testGetProducts]' passed (0.021 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testGetTransactionJsonRepresentation]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testGetTransactionJsonRepresentation]' passed (0.046 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testGetTransactions]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testGetTransactions]' passed (0.047 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testInvalidProductPurchase]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testInvalidProductPurchase]' passed (0.020 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testIsWinBackOfferEligibleEligible]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testIsWinBackOfferEligibleEligible]' passed (0.082 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testIsWinBackOfferEligibleNonSubscription]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testIsWinBackOfferEligibleNonSubscription]' passed (0.016 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testIsWinBackOfferEligibleNotEligible]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testIsWinBackOfferEligibleNotEligible]' passed (0.045 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testIsWinBackOfferEligibleProductNotFound]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testIsWinBackOfferEligibleProductNotFound]' passed (0.016 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseUpgradeConsumableSuccess]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseUpgradeConsumableSuccess]' passed (0.047 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseWithAppAccountToken]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseWithAppAccountToken]' passed (0.040 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseWithIntroductoryOfferEligibilityJWS]' started.
        .../InAppPurchaseStoreKit2PluginTests.swift:72: -[RunnerTests.InAppPurchase2PluginTests testPurchaseWithIntroductoryOfferEligibilityJWS] : Test skipped - Failed purchases hang on the iOS 27 simulator (Apple known issue 184255116).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseWithIntroductoryOfferEligibilityJWS]' skipped (0.013 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseWithPromotionalOffer]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseWithPromotionalOffer]' passed (0.046 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseWithWinBackOffer]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testPurchaseWithWinBackOffer]' passed (0.032 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testRedeemCodeSheetFailsGracefullyWhenNoWindow]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testRedeemCodeSheetFailsGracefullyWhenNoWindow]' passed (0.010 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testRestoreMultipleProductsEmitsSingleBatchedUpdate]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testRestoreMultipleProductsEmitsSingleBatchedUpdate]' passed (0.067 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testRestoreProductSuccess]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testRestoreProductSuccess]' passed (0.047 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testShowManageSubscriptionsFailsGracefullyWhenNoWindow]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testShowManageSubscriptionsFailsGracefullyWhenNoWindow]' passed (0.012 seconds).
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testSuccessfulPurchase]' started.
        Test Case '-[RunnerTests.InAppPurchase2PluginTests testSuccessfulPurchase]' passed (0.024 seconds).
        Test Suite 'InAppPurchase2PluginTests' passed at 2026-11-09 19:06:09.685.
             Executed 27 tests, with 2 tests skipped and 0 failures (0 unexpected) in 1.785 (1.793) seconds
        ...
        Test Suite 'RunnerTests.xctest' passed at 2026-11-09 19:06:09.834.
             Executed 115 tests, with 2 tests skipped and 0 failures (0 unexpected) in 3.930 (3.961) seconds
        Test Suite 'All tests' passed at 2026-11-09 19:06:09.834.
             Executed 115 tests, with 2 tests skipped and 0 failures (0 unexpected) in 3.930 (3.962) seconds
    
        ** TEST EXECUTE SUCCEEDED **
    
  5. vashworth commented on Nov 10, 2026

    @vashworth
    ContributorAuthor

    @LouiseHsu What version of Xcode are you on? I'm on Xcode 27.1, same as CI

  6. vashworth commented on Nov 10, 2026

    @vashworth
    ContributorAuthor

    /Applications/Xcode-beta.app

    Looks like you're still on a beta perhaps?

  7. added 2 commits that reference this issue on Nov 12, 2026
    8967d8c
    5162aa7
  8. LouiseHsu commented on Nov 12, 2026

    @LouiseHsu
    Contributor

    @vashworth
    Okay, I confirmed my suspicions. This is true on both 27.0 beta to 27.1. A run on a cold simulator will purchase tests will always timeout. In fact, this even repros with a vanilla UIKit app. If you run the same tests again on the same simulator, it'll pass.

    The difficulty with this issue is like unlike the previous failures, this one threw 0 errors.

    Basically, when you run StoreKitTest tests, it opens a connection to the Storekit daemon, then it pushes the storekit configuration a few ms later. The daemon, however, decides at start up time if we're in the testing environment or the sandbox. So on first run, there's no configuration on device yet, so it tries to connect to the sandbox. The tests hang for 60 secs cuz on device you get a Sign In to Apple popup. However subsequent tests will pass, because now the config exists on the device.

    You can actually see it in the storekit daemon logs. gemini grepped this

    [AccountManager] Starting [Client] dev.flutter.plugins.inAppPurchaseExample Sandbox authentication 
    Authenticating with no active account for sandbox
    

    So it's definitely not even hitting the test environment.

    I think this is an Apple bug for sure. It actually shows up finally in the 27.3 patchnotes

    Theres two solutions I think

    1. We just skip the tests XCTSkipIf until the bug is fixed. we lose a lot of coverage, but its like the easiest thing to do. We need to remember to turn it back on though eventually.
    2. A small hack is that we could embed a test pre action and have it just launch a test that doesn't actually require a test env to pass, like testCanMakePayments

    Something like

        if [ -z "$STOREKIT_WARMUP" ] && [ "$TARGET_DEVICE_PLATFORM_NAME" = "iphonesimulator" ]; then
          env -i HOME="$HOME" PATH="$PATH" DEVELOPER_DIR="$DEVELOPER_DIR" STOREKIT_WARMUP=1 \
            xcodebuild test-without-building \
              -workspace "$PROJECT_DIR/Runner.xcworkspace" -scheme Runner \
              -configuration "$CONFIGURATION" -destination "id=$TARGET_DEVICE_IDENTIFIER" \
              -only-testing:RunnerTests/InAppPurchase2PluginTests/testCanMakePayments \
              > "$TMPDIR/storekit_warmup.log" 2>&1 || true
        fi

    https://github.com/flutter/packages/compare/main...LouiseHsu:storekit-test-warmup?expand=1

  9. vashworth commented on Nov 13, 2026

    @vashworth
    ContributorAuthor

    Option 2 is probably the quickest fix without losing coverage.

    Let's put the script in it's own file, instead of directly in the pre-action (the pre-action will call the script), and then add comments on why and a TODO to remove once Xcode fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listp: in_app_purchasePlugin for in-app purchasepackageflutter/packages repository. See also p: labels.team-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions