square / in-app-payments-react-native-plugin

Apache License 2.0
118 stars 50 forks source link

Issue with SquareInAppPaymentsSDK installation through cocoapods #217

Closed AndrewBordin closed 9 months ago

AndrewBordin commented 1 year ago

Describe the issue

I encountered an error when installing this plugin at build time after following the getting started guide. The issue I received at build time was as follows:

dyld[43511]: Library not loaded: @rpath/SquareBuyerVerificationSDK.framework/SquareBuyerVerificationSDK

After getting this issue in my own app, I built the starter app as well and ran into the same error. There seems to be some issue with installing the framework through cocoapods, specifically the SquareBuyerVerificationSDK. I am using cocoapods verison 1.11.3 and react-native verison 0.72.3.

I did end up fixing the error by manually installing the In-App Payments SDK: https://developer.squareup.com/docs/in-app-payments-sdk/installation#option-3-install-the-in-app-payments-sdk-manually

As well as embedding both frameworks manually as well.

To Reproduce

Steps to reproduce the issue:

Follow the getting started guide for iOS and install the sdk with cocoapods.

Expected behavior

The app builds.

Environment (please complete the following information):

System:
  OS: macOS 13.4
  CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
  Memory: 856.60 MB / 32.00 GB
  Shell:
    version: 5.1.16
    path: /usr/local/bin/bash
Binaries:
  Node:
    version: 16.13.2
    path: ~/.nvm/versions/node/v16.13.2/bin/node
  Yarn:
    version: 1.22.17
    path: /usr/local/bin/yarn
  npm:
    version: 8.1.2
    path: ~/.nvm/versions/node/v16.13.2/bin/npm
  Watchman:
    version: 2022.09.12.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.11.3
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.2 AI-222.4459.24.2221.10121639
  Xcode:
    version: 14.3.1/14E300c
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: javac 15
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.3
    wanted: 0.72.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
talha-irshad-kodexo commented 1 year ago

Facing the same issue, it seems like the documentation hasn't been updated for ages. It is also mentioned to link the library with react native link command which is also deprecated. Also can you let me know where I should place the new run script as that also not mentioned in the documentation, is it okay if I place it as the last build phase?

CharmisG commented 1 year ago

@talha-irshad-kodexo

Please follow below steps to add the new run script:

1) In the Build Phases tab for your application target, click the + button at the top of the pane. 2) Select New Run Script Phase. 3) Paste the following into the editor panel of the new run script: FRAMEWORKS="${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}" "${FRAMEWORKS}/SquareInAppPaymentsSDK.framework/setup"

AndrewBordin commented 1 year ago

@talha-irshad-kodexo So long as the new run script is placed below the embed frameworks step you should be good. Placing it at the bottom will work.

talha-irshad-kodexo commented 1 year ago

@AndrewBordin @CharmisG I am facing another error, I have created a different issue, I would really appreciate it if you guys could help me out in that issue

AndrewBordin commented 1 year ago

@CharmisG why was this issue closed?

CharmisG commented 1 year ago

@AndrewBordin Are you still facing same issue ??

AndrewBordin commented 1 year ago

@CharmisG Yes, the issue of installing the library using the Getting Started guide still fails, as you get this error: dyld[43511]: Library not loaded: @rpath/SquareBuyerVerificationSDK.framework/SquareBuyerVerificationSDK

It will only work if you install the In-App Payments SDK manually.

AndrewBordin commented 1 year ago

@CharmisG any update? Can you re-open the issue?

CharmisG commented 1 year ago

@AndrewBordin Have you followed this below step ? https://github.com/square/in-app-payments-react-native-plugin/blob/master/docs/get-started.md#step-3b-add-the-in-app-payments-sdk-to-your-ios-project-with-cocoapods

Huynie commented 1 year ago

I'm also having this issue and I've tried everything I can find thus far:

All on a fresh project running RN 0.72.4, cocoapods 1.12:

  1. nuked everything ( node_modules, package-lock.json, ios/Pods, ios/build, podfile.lock ) then reinstalled (npm i, pod install).

  2. Manuel install following this.

I'm at a lost. Anything help is appreciated.

CharmisG commented 1 year ago

@Huynie Can you please tell me which iOS version you are using?

Huynie commented 1 year ago

@CharmisG

I've tried it on IOS version: 12.0, 12.4, 13.4, 14.0, and 16.4.

HunterT11 commented 1 year ago

I'm also having this error, can anyone help?

AndrewBordin commented 1 year ago

@HunterT11 The only way I have gotten it to work is by manually installing the SDK. Take a look at this link (make sure you switch it from Java Android to iOS, and then scroll down to option 3). Then you will have to embed both frameworks manually, here is how to do that.

AndrewBordin commented 1 year ago

I'm also having this issue and I've tried everything I can find thus far:

All on a fresh project running RN 0.72.4, cocoapods 1.12:

  1. nuked everything ( node_modules, package-lock.json, ios/Pods, ios/build, podfile.lock ) then reinstalled (npm i, pod install).
  2. Manuel install following this.

I'm at a lost. Anything help is appreciated.

What error are you running into when installing the sdk manually?

HunterT11 commented 1 year ago

i have added it, thank you very much <3 Thanks& regards, Nguyen Hoang Thach

Vào Th 4, 20 thg 9, 2023 vào lúc 21:24 Andrew @.***> đã viết:

I'm also having this issue and I've tried everything I can find thus far:

All on a fresh project running RN 0.72.4, cocoapods 1.12:

  1. nuked everything ( node_modules, package-lock.json, ios/Pods, ios/build, podfile.lock ) then reinstalled (npm i, pod install).
  2. Manuel install following this https://developer.squareup.com/docs/in-app-payments-sdk/installation#option-3-install-the-in-app-payments-sdk-manually .

I'm at a lost. Anything help is appreciated.

What error are you running into when installing the sdk manually?

— Reply to this email directly, view it on GitHub https://github.com/square/in-app-payments-react-native-plugin/issues/217#issuecomment-1727838896, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJTODXI55WYMT6JGMKABOQ3X3L4BDANCNFSM6AAAAAA3LUA2MM . You are receiving this because you were mentioned.Message ID: @.*** com>

HunterT11 commented 1 year ago

but ios 13 crash, do you have this error Thanks& regards, Nguyen Hoang Thach

Vào Th 4, 20 thg 9, 2023 vào lúc 21:24 Andrew @.***> đã viết:

I'm also having this issue and I've tried everything I can find thus far:

All on a fresh project running RN 0.72.4, cocoapods 1.12:

  1. nuked everything ( node_modules, package-lock.json, ios/Pods, ios/build, podfile.lock ) then reinstalled (npm i, pod install).
  2. Manuel install following this https://developer.squareup.com/docs/in-app-payments-sdk/installation#option-3-install-the-in-app-payments-sdk-manually .

I'm at a lost. Anything help is appreciated.

What error are you running into when installing the sdk manually?

— Reply to this email directly, view it on GitHub https://github.com/square/in-app-payments-react-native-plugin/issues/217#issuecomment-1727838896, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJTODXI55WYMT6JGMKABOQ3X3L4BDANCNFSM6AAAAAA3LUA2MM . You are receiving this because you were mentioned.Message ID: @.*** com>

Huynie commented 11 months ago

I'm still having issues getting my app to build from installing this through cocoapods and manually. I've tried it on IOS 15.0 all the way up to 17.0 with no luck.

I've even tried the react-native-in-app-payments-quickstart example project and got as far as building the app, but the app crashes upon launch.

Any help would be appreciated.