BlackBoxVision / react-native-mercadopago-px

🚀 MercadoPago PX bridge for react-native
https://react-native-mercadopago-px.blackbox-vision.tech
MIT License
103 stars 25 forks source link

Not being able to build for iOS #29

Closed JuanAraneta closed 3 years ago

JuanAraneta commented 3 years ago

Describe the bug Once I follow the instructions on the repo and run for iOS I get Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. on the VS code terminal. Once I open Xcode and tried to build I get module map file '/Users/juampy/Library/Developer/Xcode/DerivedData/xxxxxxxx-dtwuehfxifcnstgzpzwzcqvoxuud/Build/Products/Debug-iphonesimulator/MLBusinessComponents/MLBusinessComponents.modulemap' not found.. Sometimes when I successfully open the app and try to call MercadoPagoCheckout.createPayment I get TypeError: null is not an object (evaluating '_reactNative.NativeModules.ReactNativeMercadopagoPx.createPayment') .It works on android

To Reproduce Steps to reproduce the behavior:

  1. Follow the instructions on the repo
  2. Run yarn ios (react-native run-ios)
  3. See error

Expected behavior The build succeed and the app runs on simulator as before the library got installed.

Screenshots

Screen Shot 2020-11-23 at 18 18 11

Smartphone (please complete the following information):

Dependencies "@blackbox-vision/react-native-mercadopago-px": "^0.7.0", "@react-native-community/masked-view": "^0.1.10", "@react-native-firebase/app": "^8.4.7", "@react-native-firebase/auth": "^9.3.2", "@react-native-firebase/firestore": "^7.9.1", "@react-navigation/bottom-tabs": "^5.10.0", "@react-navigation/native": "^5.8.0", "@react-navigation/stack": "^5.12.5", "axios": "^0.21.0", "contentful": "^7.14.8", "react": "16.13.1", "react-contentful": "^2.0.30", "react-native": "0.63.3", "react-native-gesture-handler": "^1.8.0", "react-native-linear-gradient": "^2.5.6", "react-native-reanimated": "^1.13.1", "react-native-safe-area-context": "^3.1.8", "react-native-screens": "^2.14.0", "react-native-splash-screen": "^3.2.0", "react-native-svg": "^12.1.0", "react-native-svg-uri": "^1.2.3", "react-native-vector-icons": "^7.1.0", "react-native-video": "^5.1.0-alpha8", "react-navigation": "^4.4.3", "react-navigation-tabs": "^2.10.0"

JuanAraneta commented 3 years ago

I'm using "react-native": "0.63.3". One think I see is that my podfile looks a little bit different to the one on the readme.

This is the way I added the use_modular_headers! to the file.

use_modular_headers! config = use_native_modules!

After following all the steps again I'm getting use_native_modules! skipped the react-native dependency 'react-native-mercadopago-checkout'. No podspec file was found..

JonatanSalas commented 3 years ago

Hi @JuanAraneta, would you mind to follow the following steps from the README?

https://github.com/BlackBoxVision/react-native-mercadopago-px#in-ios-when-running-app-some-strings-are-missing

We've noticed some issues regarding on how the MercadoPagoSDK is exported, and we're trying to see how we can improve from the library perspective, so users don't have more issues.

JuanAraneta commented 3 years ago

@JonatanSalas Thank you so much for your reply, even after carefully following the steps on the readme and the missing strings part, I'm still seeing Cannot read property 'createPayment' of undefined. Is it possible we need to manually link the library? I'm not an iOS expert. If I log the MercadoPagoCheckout object I can see the createPayment function but I'm facing the error when calling it 😪

Now when I tried to build with Xcode I'm getting error: value of optional type 'Int64?' must be unwrapped to a value of type 'Int64' at the finishCheckout function 😭

DavidEvangelista commented 3 years ago

I'm having the same problem as @JuanAraneta , after updating to version 0.7.1

correafer commented 3 years ago

Im facing the same issue, but using expo 39.0.0 RN SDK 39.0.3 and Library version 0.7.1 on android. When the funcion MercadoPagoCheckout.createPayment gets executed, it throws the same error as our friend on xcode...

JonatanSalas commented 3 years ago

@JuanAraneta do you have an open repository to check the issue?

JuanAraneta commented 3 years ago

It's a private one but I'll set a public repo that replicate the issue.

JonatanSalas commented 3 years ago

@JuanAraneta I've checked the code and fixed that Int64 warning that prevents from compiling the library with the following line:

payment[JsPaymentOptions.ID] = String(pxPayment!.id);

I'm currently testing to see if everything is alright, and release a hotfix.

JonatanSalas commented 3 years ago

@JuanAraneta please try with version 0.7.2, if your issue persists let me know when you have a repo and I'll review it to see where the problem is.

JuanAraneta commented 3 years ago

Understood! However, I'd already tried with that same fix and the Cannot read property 'createPayment' of undefined was still appearing. I'll set up a repo.

JuanAraneta commented 3 years ago

@JonatanSalas sorry for the delay, Here is the repo.