braintree / braintree_ios

Braintree SDK for iOS
https://developer.paypal.com/braintree/docs/start/hello-client/ios/v5
MIT License
557 stars 291 forks source link

BraintreeCore Fails to Build in Xcode 16 Beta 3 with Error: Type 'UIApplication' does not conform to protocol 'URLOpener' #1359

Closed RGG-jayoung closed 1 month ago

RGG-jayoung commented 1 month ago

Braintree SDK Version

6.17.10 - 6.22.0

Environment

Both

Xcode Version

Xcode 16 Beta 3

OS Version & Device

iOS 18

Integration type

Swfit Package Manager

Development Processor

Apple Silicon (M-series chips)

Describe the bug

After updating to Apple's latest Beta 3, BraintreeCore fails to build due the following compiler error:

// Error Message
Type 'UIApplication' does not conform to protocol 'URLOpener'
// Fixit Suggestion
Candidate has non-matching type '(URL, [UIApplication.OpenExternalURLOptionsKey : Any], (@MainActor @Sendable (Bool) -> Void)?) -> Void' (UIKit.UIApplication)

It seems that the UIApplication+URLOpener.swift conformance to URLOpener requires stubs to fulfill it's contract.

To reproduce

  1. Open a project configured with the Braintree SDK with Xcode 16 Beta 3
  2. Attempt to build an App Target that imports BraintreeCore.
  3. Build will fail with the error.

Other steps taken:

Expected behavior

App target should build without issue like Xcode 16 Beta 1 and Xcode 16 Beta 2

Screenshots

Braintree Core - Application URLOpener Conformance Braintree Core - Application URLOpener Confirmance - SDK 6_17_0 Braintree Core - Application File
jaxdesmarais commented 1 month ago

Hey @RGG-jayoung -

Thanks for bringing this issue to our attention! The method signature for this changed in Xcode 16 beta 3 (apple dev docs diff here). Since changing to the new signature in our protocol would then produce the same error you are seeing in versions lower than Xcode 16 beta 3, we will need to under the hood call the both the old and new method.

I've done some testing in Xcode 16 beta 3 as well as Xcode 15.4 and the change in PR #1360 seems to resolve both issues. If you'd like to pull down that branch and let us know if you're seeing the issue resolved on your end, please feel free.

jqsilver commented 1 month ago

I also ran into this today, so I'm happy to see this getting addressed so quickly!

FlorianTousch commented 1 month ago

Same here, Bitrise don't build anymore (XCode is building well)

CleanShot 2024-07-10 at 10 46 42@2x

jaxdesmarais commented 1 month ago

Hey all -

The fix for this issue has been released in version 6.23.0 of the SDK. Thanks again for bringing this to our attention!