iOS build fails with Undefined symbols
Description
Hi, after updating react native to 0.76.6 I ran into multiple errors
Undefined symbol: facebook::react::RNSVGUseProps::RNSVGUseProps(facebook::react::PropsParserContext const&, facebook::react::RNSVGUseProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSScreenProps::RNSScreenProps(facebook::react::PropsParserContext const&, facebook::react::RNSScreenProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSVGDefsProps::RNSVGDefsProps(facebook::react::PropsParserContext const&, facebook::react::RNSVGDefsProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSVGLineProps::RNSVGLineProps(facebook::react::PropsParserContext const&, facebook::react::RNSVGLineProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSVGMaskProps::RNSVGMaskProps(facebook::react::PropsParserContext const&, facebook::react::RNSVGMaskProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSVGPathProps::RNSVGPathProps(facebook::react::PropsParserContext const&, facebook::react::RNSVGPathProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSVGRectProps::RNSVGRectProps(facebook::react::PropsParserContext const&, facebook::react::RNSVGRectProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSVGTextProps::RNSVGTextProps(facebook::react::PropsParserContext const&, facebook::react::RNSVGTextProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSVGImageProps::RNSVGImageProps(facebook::react::PropsParserContext const&, facebook::react::RNSVGImageProps const&, facebook::react::RawProps const&)
etc.
Steps to reproduce
- update to react native 0.76
- try building app in xcode
Snack or a link to a repository
can't share my repo because it's private
SVG version
15.11.1
React Native version
0.76.6
Platforms
iOS
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
Hey! 👋
The issue doesn't seem to contain a minimal reproduction.
Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?
Hi, I've just double-checked that, and everything builds perfectly fine using [email protected] and [email protected]. I recommend you to ensure all your dependencies are correctly updated and aligned. Additionally, clearing the cache, builds, node_modules and pods might help resolve your issue. Let me know if you need further help!
Also, it looks like you might have forgotten to run bundle exec pod install in /ios directory
I did the pod install and I still get the above errors when upgrade to RN 76
Seems like this issue relates to the new react native architecture that is used by default on RN 0.76.+
For now, you can opt out by adding the following line to your Podfile
ENV['RCT_NEW_ARCH_ENABLED'] = "0"
I added ENV['RCT_NEW_ARCH_ENABLED'] = "0", but it did not resolve my problem.
@rwillemsandroid won't react-native-svg support the new architecture? I updated RN specifically to use the new architecture
won't react-native-svg support the new architecture? I updated RN specifically to use the new architecture
It does support the new architecture for a long time. I wouldn't recommend setting ENV['RCT_NEW_ARCH_ENABLED'] = "0" . The issue you're facing is likely cache-related, so try removing the build and pods catalogs from /ios folder using this command (ensure Xcode is closed beforehand):
rm -rf build/ Pods/ Podfile.lock
Then, reinstall the Pods using:
bundle exec pod install
Once that's done, you should be able to open Xcode and successfully build the app.
I deleted all those folders and files, I even deleted DerivedData and ran bundle exec pod install, but it didn't help The errors are not from my "main target", but from NotificationServiceExtension
Without a minimal reproduction repository and based on your responses (NotificationServiceExtension, which is unrelated to react-native-svg, along with the screenshot from @YOEL311 showing errors from other libraries), I assume the issue is with the notification library you’re using. Therefore, I recommend opening an issue in that library's repository
did solve it? same issue here
Still having the same issue here...
Please provide a minimal reproduction repository with only react-native-svg installed, as it's necessary to investigate this issue.
I find Sulotoin for this
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => flags[:hermes_enabled],
:new_arch_enabled => false, // add this
:fabric_enabled => false, //
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
i need a new architecture. can you give solution without :new_arch_enabled => false,
For newarch, you need
‘’’’
:new_arch_enabled => true,
:fabric_enabled => true
‘’’’
Also need install pod with this env
RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
not work for me ( Undefined symbol: facebook::react::RNSVGMaskProps::RNSVGMaskProps(facebook::react::PropsParserContext const&, facebook::react::RNSVGMaskProps const&, facebook::react::RawProps const&) ` use_react_native!( :path => config[:reactNativePath],
:hermes_enabled => false,
:new_arch_enabled => true,
:fabric_enabled => true
)`
why hermes_enabled= false
It needs to be true with new arch
I faced the same errors when migrating to the new architecture. Check your Podfile and delete this if you have it:
install! 'cocoapods', :disable_input_output_paths => true # <- delete this line
Reinstall pods. This is what caused the issue in my case. Hope this helps someone else
React Native 0.76 introduced new architecture by default. This means that when your run “pod install” in 0.76 or newer, it will assume new architecture. If you haven’t migrated to new arch yet, you’ll need to opt-out with RCT_NEW_ARCH_ENABLED=0 env variable:
RCT_NEW_ARCH_ENABLED=0 bundle exec pod install
You can read more here: https://reactnative.dev/blog/2024/10/23/the-new-architecture-is-here#opt-out
@csillaj Did you fond the fix for it. I have recently migrated to 0.79.2 , facing same issue when new_arch is enabled
This helped!
RCT_NEW_ARCH_ENABLED=0 bundle exec pod install
I faced this issue multiple times after upgrading my version. In every instance, the problem was resolved after I aligned the Podfile with the upgrade helper.
👋 someone has got any solution to build rn-svg 15.12.1 when enabling new arch on iOS. I'm upgrading react-native-maps lib that require new arch but react-native-svg become blocker!
Any helps are welcome/appreciated.
cc: @msand do you happen to know how we can fix this issue? Or do you know whom should we connect with it? I'm getting this issue in RN 0.78 and latest version of react-native-svg when fabric and new-arch is enabled
Getting also the same issue with react-native v0.81 I need the New Architecture enabled, and that's when the error occurs. Already tried with react-native-svg v15.12.1 and v15.13.0
same issue
any update on this? this is blocking us from opting into the new architecture
I'll close this issue as it doesn't contribute anything new.
Like I mentioned the last time, please create a new issue providing a minimal reproducible repository with only react-native-svg installed so we can investigate this further.