react-native-svg icon indicating copy to clipboard operation
react-native-svg copied to clipboard

Unable to build for macOS with new arch enabled

Open ryanlntn opened this issue 1 year ago • 2 comments

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.

  1. git clone https://github.com/software-mansion/react-native-svg
  2. cd react-native-svg
  3. yarn
  4. cd Example/macos
  5. RCT_NEW_ARCH_ENABLED=1 pod install
  6. cd ..
  7. yarn macos

Describe what you expected to happen:

  1. The macOS app should build without failure

ryanlntn avatar Dec 11 '23 19:12 ryanlntn

Same problem in

    "react-native-svg": "15.1.0",
    "react-native-macos": "0.73.26",

ywisax avatar May 05 '24 13:05 ywisax

same issue here, and not only this error.

image

dev-johnny-gh avatar May 07 '24 15:05 dev-johnny-gh

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 avatar Jun 13 '24 09:06 jakex7

@jakex7 I spun up a minimal repro here: https://github.com/ryanlntn/SVGMacOSRepro

ryanlntn avatar Jun 13 '24 20:06 ryanlntn

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

ryanlntn avatar Jun 19 '24 01:06 ryanlntn

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

bohdanprog avatar Jul 25 '24 06:07 bohdanprog

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!

leonskim avatar Aug 19 '24 19:08 leonskim