react-native-svg
react-native-svg copied to clipboard
Unable to build for macOS with new arch enabled
Bug
RNSVG fails to build on macOS when RCT_NEW_ARCH_ENABLED
.
Unexpected behavior
The build fails with Property 'center' not found on object of type 'RNSVGUse *'
in RNSVGUse.mm. This doesn't happen with iOS builds or without the new arch enabled.
Environment info
React native info output:
System:
OS: macOS 14.1.2
CPU: (10) arm64 Apple M1 Pro
Memory: 198.45 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 21.2.0
path: ~/.asdf/installs/nodejs/21.2.0/bin/node
Yarn:
version: 1.22.21
path: /opt/homebrew/bin/yarn
npm:
version: 10.2.3
path: ~/.asdf/plugins/nodejs/shims/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.12.1
path: /Users/ryan/.asdf/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.0
- iOS 17.0
- macOS 14.0
- tvOS 17.0
- watchOS 10.0
Android SDK: Not Found
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.10121639
Xcode:
version: 15.0.1/15A507
path: /usr/bin/xcodebuild
Languages:
Ruby:
version: 3.2.2
path: /Users/ryan/.asdf/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.6
wanted: 0.72.6
react-native-macos:
installed: 0.71.33
wanted: ^0.71.0-0
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: Not found
Library version: main
Steps To Reproduce
Issues without reproduction steps or code are likely to stall.
- git clone https://github.com/software-mansion/react-native-svg
- cd react-native-svg
- yarn
- cd Example/macos
- RCT_NEW_ARCH_ENABLED=1 pod install
- cd ..
- yarn macos
Describe what you expected to happen:
- The macOS app should build without failure
Same problem in
"react-native-svg": "15.1.0",
"react-native-macos": "0.73.26",
same issue here, and not only this error.
Hi, thank you for reporting this issue. To investigate further, we need a minimal reproduction repository. Once you have the repository ready, please share the link here.
@jakex7 I spun up a minimal repro here: https://github.com/ryanlntn/SVGMacOSRepro
@jakex7 I was able to get this compiling for macOS with new arch using this patch. If that seems like a reasonable approach I'd be happy to open a PR.
@jakex7 I was able to get this compiling for macOS with new arch using this patch. If that seems like a reasonable approach I'd be happy to open a PR.
Hello @ryanlntn,
Thank you for your advice regarding the patch. We followed your suggestion and created a PR that has already been merged. If you have the time, we would appreciate it if you could test it based on the main branch.
Thank you.
Hi, @bohdanprog! I know this is already closed but just wanted to let you know that the latest version works on the project that I'm working on with @ryanlntn. Thank you so much!