react-native-braintree-xplat icon indicating copy to clipboard operation
react-native-braintree-xplat copied to clipboard

Support RN 0.60+ autolinking

Open WoodyWoodsta opened this issue 5 years ago • 12 comments

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 avatar Aug 22 '19 15:08 WoodyWoodsta

@WoodyWoodsta have you found any work around yet for this problem, i am getting error 'React/RCTBridgeModule.h' file not found

sam17896 avatar Aug 30 '19 11:08 sam17896

That sounds unrelated.

WoodyWoodsta avatar Aug 30 '19 13:08 WoodyWoodsta

It is kind of related, it is what happens if you manually link then try to build.

cubabit avatar Sep 04 '19 11:09 cubabit

@sam17896 any luck figuring this out?

wkoutre avatar Sep 17 '19 00:09 wkoutre

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 because 4.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!

wkoutre avatar Sep 27 '19 21:09 wkoutre

@sam17896 Where you able to find a solution to that issue?

alexkendall avatar Apr 06 '21 23:04 alexkendall

@wkoutre Your fork isn't currently compiling for me. I'm receiving deprecation errors for some of the methods.

alexkendall avatar Apr 07 '21 15:04 alexkendall

@alexkendall If you're able to share some logs, I can check it out. Currently using my fork in production without issues.

wkoutre avatar Apr 07 '21 16:04 wkoutre

@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

alexkendall avatar Apr 07 '21 16:04 alexkendall

Hm, it seems like (for some reason) warnings are being treated as errors; I'd look into that (check your compiler flags)

wkoutre avatar Apr 07 '21 16:04 wkoutre

@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?

alexkendall avatar Apr 07 '21 16:04 alexkendall

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?

wkoutre avatar Apr 08 '21 23:04 wkoutre