Skip to content

🐛 Bug: Enum type mismatch causes build failure on Xcode 26+ #2357

Description

@shubhanshubb

StripeSwiftInterop.h forward-declares STPPaymentStatus using NSUInteger (unsigned), while the actual definition in StripePayments is:

@objc public enum STPPaymentStatus: Int

This maps to NSInteger (signed).

With Xcode 26+, this mismatch is now treated as a hard compile-time error, whereas older Xcode versions only raised a warning.

To Reproduce
Create a React Native project
Install:
@stripe/stripe-react-native@0.59.2 (also reproducible on 0.60.0)

Enable:

use_frameworks! :linkage => :static

Run:

pod install
Build the project in Xcode 26.4
Actual Result

Build fails with:

stripe_react_native-Swift.h:690: error:
enumeration redeclared with different underlying type
'NSInteger' (aka 'long') (was 'NSUInteger' (aka 'unsigned long'))
Expected Result

The project should compile successfully without enum type conflicts.

Root Cause

Mismatch between:

// StripeSwiftInterop.h (incorrect)
typedef NS_ENUM(NSUInteger, STPPaymentStatus);

and actual Swift enum:

@objc public enum STPPaymentStatus: Int
Proposed Fix

Update the forward declaration in:

ios/StripeSwiftInterop.h

  • typedef NS_ENUM(NSUInteger, STPPaymentStatus);
  • typedef NS_ENUM(NSInteger, STPPaymentStatus);
    Environment
    macOS: 26.4 (Darwin 25.4.0)
    Xcode: 26.4 (17E192)
    CocoaPods: 1.16.2
    Ruby: 4.0.1
    React Native Stripe: 0.59.2 / 0.60.0
    Additional Context
    This issue appears only on Xcode 26+
    Likely due to stricter compiler enforcement of enum ABI compatibility
    Affects projects using use_frameworks! :linkage => :static
Image

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions