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

[iOS] Library project generated for Turbo Module fails to build with React Native 0.77.0 #755

Open
1 of 2 tasks
birdofpreyru opened this issue Jan 24, 2025 · 4 comments
Open
1 of 2 tasks
Labels
bug Something isn't working

Comments

@birdofpreyru
Copy link
Contributor

birdofpreyru commented Jan 24, 2025

Description

Linker reports duplicated symbols, in my current understanding they happen because of a name clash between the code generated by codegen for the library, and some similar code generated by codegen for the app itself (the screenshot is from a library I maintain, after resetting its scaffolding with the latest create-react-native-library version, and [email protected]; but I got the same problem with just new project created by create-react-native-library, with no subsequent changes):
Image

Packages

  • create-react-native-library
  • react-native-builder-bob

Selected options

N/A

Link to repro

https://github.com/birdofpreyru/react-native-fs/tree/dev-v2.31

Environment

N/A

@birdofpreyru birdofpreyru added the bug Something isn't working label Jan 24, 2025
@birdofpreyru
Copy link
Contributor Author

Might be related to #754 — exploring my project I see that Codegen generates some .podspec file into android/generated path... so I guess, it might be also unnecessary generating some code intended only for the app into folders related to the library?

@elichai
Copy link

elichai commented Jan 26, 2025

Same issue,
According to this: https://github.com/reactwg/react-native-new-architecture/blob/main/docs/turbo-modules.md#4-native-code
The library shouldn't provide any generated code according to:

Warning
The code generated by Codegen in this step should not be committed to the versioning system. React Native apps are able to generate the code when the app is built. This allows an app to ensure that all libraries have code generated for the correct version of React Native. It is also possible to include the codegen output into your library.

EDIT: I now found this: https://github.com/reactwg/react-native-new-architecture/blob/main/docs/codegen.md#including-generated-code-into-libraries so I'm no longer sure :)

@ospfranco
Copy link

I just created a new library and also faced duplicated symbols. I guess there is something about the template that breaks.

That being said I also faced an issue with included codegen code in the distribution

facebook/react-native-website#4460

This was also discussed internally in the react-native maintainer discord and indeed the documentation is not clear. Codegen code can break between versions, so builder-bob should not turn on this IMO.

In any case, if you guys have a workaround to get builder-bob working with the C++ template again let me know. Maybe it's just a case of downgrading to 0.76.6.

@elichai
Copy link

elichai commented Jan 26, 2025

@ospfranco It seems that USE_FRAMEWORKS=dynamic bundle exec pod install solves it, not sure if it's the right solution but it does seems to solve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants