Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Unable to build for macOS with new arch enabled #2192

Closed
ryanlntn opened this issue Dec 11, 2023 · 6 comments · Fixed by #2341
Closed

Unable to build for macOS with new arch enabled #2192

ryanlntn opened this issue Dec 11, 2023 · 6 comments · Fixed by #2341

Comments

@ryanlntn
Copy link

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
@ywisax
Copy link

ywisax commented May 5, 2024

Same problem in

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

@dev-johnny-gh
Copy link

dev-johnny-gh commented May 7, 2024

same issue here, and not only this error.

image

@jakex7
Copy link
Member

jakex7 commented Jun 13, 2024

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 jakex7 added the Missing repro This issue need minimum repro scenario label Jun 13, 2024
ryanlntn added a commit to ryanlntn/SVGMacOSRepro that referenced this issue Jun 13, 2024
@ryanlntn
Copy link
Author

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

@ryanlntn
Copy link
Author

ryanlntn commented Jun 19, 2024

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

@bohdanprog bohdanprog added bug Repro provided and removed Missing repro This issue need minimum repro scenario labels Jul 10, 2024
bohdanprog added a commit that referenced this issue Jul 23, 2024
# Summary
Based on recommendations from this
[proposition](#2192 (comment))
and added some changes now we can build macOS using the new
architecture.

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| macOS     |    ✅     |

---------

Co-authored-by: Maciej Stosio <[email protected]>
@bohdanprog
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants