braintree / braintree-ios-drop-in

Braintree Drop-in for iOS

Home Page:https://developers.braintreepayments.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'topLayoutGuide' is deprecated: first deprecated in iOS 11.0

mavris opened this issue · comments

General information

  • SDK/Library version: 4.31.0
  • Environment: Both
  • iOS Version and Device: iOS 13.2.2
  • Integration type and version: CocoaPods

Issue description

When I set the iOS Deployment Target to iOS 11.0 in Pods for BrainTreeDropIn I am getting the following errors:

'topLayoutGuide' is deprecated: first deprecated in iOS 11.0 - Use view.safeAreaLayoutGuide.topAnchor instead of topLayoutGuide.bottomAnchor

Hi. Thanks for pointing this out. For now, please ignore the warning until we release a version with this fix. We can update here once that happens.

This was not a warning! It was an error

Hi @mavris. Our SDK supports a minimum deployment target of iOS 9. Why do you need to change the deployment target of the SDK itself, instead of just your app's target? Leaving the SDK's deployment target as-is should work fine within your app targeting iOS 11.

This was fixed in v8.1.0

@mavris I have this same issue. Were you able to workaround this?

@alexkendall What version of Braintree Drop-in are you using? This issue should be fixed in version 8.1.0.

@scannillo still throws an error in 8.2.0 for react-native-braintree-dropin-ui. any solutions for this?

react-native-braintree-dropin-ui must be using an old version of braintree-ios-drop-in. Braintree/PayPal doesn't officially support that react native SDK, so you should raise your concern with them, or integrate with braintree-ios-drop-in directly.

commented

@scannillo I am also seeing this error with react-native-braintree-dropin-ui and BraintreeDropIn (8.2.0). I created a minimal repro React Native project: https://github.com/mlazari/BraintreeDropInErrorRepro

There are 4 errors at these lines:

Screenshot 2021-11-25 at 13 05 46

Regarding your question about the need to change the deployment target of the SDK itself - it is a workaround for M1 Apple processors in React Native that changes it at this line in Podifle: https://github.com/mlazari/BraintreeDropInErrorRepro/blob/main/ios/Podfile#L28

When commenting that line I am getting linking errors on Apple's M1 processor (which is probably why that line was added):
Screenshot 2021-11-25 at 13 14 04

This is what that lines does: https://github.com/facebook/react-native/blob/v0.66.3/scripts/react_native_pods.rb#L216
It seems to change IPHONEOS_DEPLOYMENT_TARGET to 11.0 for all pods + a fix for Flipper dependency.

commented

@andrew-stupchuk Thank you, it seems to fix that error indeed. Unfortunately I am seeing the link errors in the screenshots above once I add :inhibit_warnings => true and try to run on M1 simulators. Even if the error doesn't seem to contain anything related to Braintree dependencies, the error goes away when removing Braintree. I guess it just doesn't support M1 simulators yet.
My guess it is somehow related to these changes:

pod 'Braintree', '4.36.0'
pod 'BraintreeDropIn', '8.1.1', :inhibit_warnings => true

But still no luck, receiving a different error:

Showing Recent Errors Only
Building for iOS Simulator, but linking in dylib built for iOS, file '/Users/mihai/Desktop/Repos/BraintreeDropInErrorRepro/ios/Pods/Braintree/Frameworks/CardinalMobile.framework/CardinalMobile' for architecture arm64

I guess I'll have to run only on a real iPhone for now...

commented

Oh, I found we can force the app to be built only for x86_64 for the simulator and the simulator will use Rosetta for app's process: https://blog.sudeium.com/2021/06/18/build-for-x86-simulator-on-apple-silicon-macs/
Tried it and seems to work fine: mlazari/BraintreeDropInErrorRepro@31b0a66

first uninstall package react-native-braintree-dropin-ui
now add these lines in your podfile

pod 'Braintree', '4.36.0'
pod 'BraintreeDropIn', '8.1.1', :inhibit_warnings => true

after this run this command
cd ios && pod install && cd ..

and now install package -> npm i react-native-braintree-dropin-ui
now again install pod

this may help you in my case this error solved by these steps