react-native-braintree-dropin-ui icon indicating copy to clipboard operation
react-native-braintree-dropin-ui copied to clipboard

Error being thrown instead of a warning for bottomLayoutGuide being deprecated

Open smcgee31 opened this issue 4 years ago • 3 comments

I'm using Xcode 12.2 and when I build I'm getting an error that says 'bottomLayoutGuide' is deprecated: first deprecated in iOS 11.0 (similar message for 'topLayoutGuide') There are three instances of this error that all happen in the BTDropInController.m file:

  • safeAreaHeight
  • topLayoutAnchor
  • bottomLayoutAnchor

Each of these instances all have a check for iOS 11 if (@available(iOS 11.0, *)) and my Deployment Target is set to iOS 11.0 so I can't figure out why I'm getting an error instead of just a warning since the code checks for iOS 11.0 or greater . I've tried setting my Deployment Target to iOS 12.0 to see of that helps but there is no change.

smcgee31 avatar Jan 15 '21 21:01 smcgee31

Hi @smcgee31, Did you manage to find a fix for this?

dclawson avatar May 10 '21 15:05 dclawson

I finally just had to remove the if - else statement in each of those locations in the BTDropInController.m file simply returning what is returned if iOS 11.0 were to be found. I should have filed an issue with Braintree but got busy, as usual, and didn't. :(

smcgee31 avatar May 20 '21 00:05 smcgee31

You can resolve this by adding a post-install step in your Podfile where you disable deprecation warnings

installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        config.build_settings['GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS'] = 'NO'      
    end
end

tinchev avatar Aug 05 '22 15:08 tinchev