Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

@rebox supporting react-native-svg on Xcode 12 #260

Closed
irminakacz opened this issue Mar 24, 2021 · 2 comments
Closed

@rebox supporting react-native-svg on Xcode 12 #260

irminakacz opened this issue Mar 24, 2021 · 2 comments

Comments

@irminakacz
Copy link
Contributor

irminakacz commented Mar 24, 2021

Hi 👋
I was trying to use @rebox on Xcode 12.4 with additional dependency react-native-svg, but it was resulting in this error:

The following build commands failed:
        Ld /Users/user.name/Library/Developer/Xcode/DerivedData/rebox-byjvpkhoayqrwpfsuipmqmyqgpzv/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNSVG.build/Objects-normal/x86_64/Binary/RNSVG normal x86_64
(1 failure)

After some research, I found that this specific fix seems to work:
software-mansion/react-native-svg#1510
(replacing 'React' with 'React-Core' inside ./node_modules/react-native-svg/RNSVG.podspec)

So far I'm using it by adding a simple postinstall script in my project:

  "scripts": {
    "postinstall": "sed -i '' \"s/'React'/'React-Core'/\" ./node_modules/react-native-svg/RNSVG.podspec"
  },

My question is: Do you think it makes sense and if it's possible to have a fix inside rebox?
I've seen more people having similar issues with different dependencies,
but I didn't manage to get their proposed solution to work rebox: facebook/react-native#29633

@irminakacz
Copy link
Contributor Author

irminakacz commented Mar 24, 2021

After testing it in pipeline it seems that this sed command fails for linux (was written on macOS), but perl seems to work fine on both :)

 "scripts": {
    "postinstall": "perl -pi -e \"s/'React'/'React-Core'/g\" ./node_modules/react-native-svg/RNSVG.podspec"
  },

@deepsweet
Copy link
Member

hi!

react-native-svg dependency is not a built-in part of rebox anymore, therefore we can't monkey-patch every single 3rd-party dependency because it's up to a user-land now.

as per facebook/react-native#29633:

The correct fix going forward is for all these libs to update their dependency from React to React-Core

I think the only solution until it's not fixed by react-native-svg authors would be to patch it from your side.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants