react-native-braintree-xplat
react-native-braintree-xplat copied to clipboard
Support RN 0.60+ autolinking
Installing this module and using it results in the error indicating that the module does not support the new autolinking.
https://facebook.github.io/react-native/blog/2019/07/03/version-60#native-modules-are-now-autolinked
@WoodyWoodsta have you found any work around yet for this problem, i am getting error 'React/RCTBridgeModule.h' file not found
That sounds unrelated.
It is kind of related, it is what happens if you manually link then try to build.
@sam17896 any luck figuring this out?
FWIW I figured this out.
I have a fork working with autolinking.
In case you want to do it on your own, the TLDR is:
- Create a
RCTBraintree.podspec
- Remove
ios/RCTBraintree/Braintree
repo - in the
podspec
add something like:
s.dependency 'Braintree', '4.11.0'
s.dependency 'BraintreeDropIn'
s.dependency 'Braintree/PayPal'
s.dependency 'Braintree/Apple-Pay', '4.11.0'
s.dependency 'Braintree/3D-Secure'
s.dependency 'Braintree/DataCollector'
-
4.11.0
because4.9.6
has a syntactical issue - You may not need all of these dependencies (my app does)
Checkout the podspec in the fork above for an example if you're unsure. Good learning experience!
@sam17896 Where you able to find a solution to that issue?
@wkoutre Your fork isn't currently compiling for me. I'm receiving deprecation errors for some of the methods.
@alexkendall If you're able to share some logs, I can check it out. Currently using my fork in production without issues.
@wkoutre Thanks for taking a look. Currently I'm receiving the following errors:
.../ios/Pods/Braintree/BraintreeUI/Drop-In/BTDropInErrorAlert.m:79:1: Implementing deprecated method
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlertView.h:71:1: Method 'alertView:clickedButtonAtIndex:' declared here
.../ios/Pods/BraintreeDropIn/BraintreeDropIn/BTDropInController.m:199:176: 'bottomLayoutGuide' is deprecated: first deprecated in iOS 11.0 - Use view.safeAreaLayoutGuide.bottomAnchor instead of bottomLayoutGuide.topAnchor
.../ios/Pods/BraintreeDropIn/BraintreeDropIn/BTDropInController.m:324:68: 'topLayoutGuide' is deprecated: first deprecated in iOS 11.0 - Use view.safeAreaLayoutGuide.topAnchor instead of topLayoutGuide.bottomAnchor
XCode Version 12.4
Hm, it seems like (for some reason) warning
s are being treated as error
s; I'd look into that (check your compiler flags
)
@wkoutre My compiler flags have "Treat Warnings as Errors" set to "No". Unsure how to work around this. What version of react-native and Xcode are you currently using?
Hey, sorry @alexkendall -- missed this response yesterday.
I'm on [email protected] and Xcode 12.4 using new build system (not legacy).
Is it possible for you to point me to a repo replicating the issue you're having?