react-native-builder-bob icon indicating copy to clipboard operation
react-native-builder-bob copied to clipboard

Reference to swift-5

Open jmkolbe opened this issue 4 years ago • 1 comments

Environment

version 0.20.1 MacOS 12.3.1 NPM 8.9.0 yarn 1.22.19

Description

A new project produces an Xcode project with swift-5 LIBRARY_SEARCH_PATHS

Reproducible Demo

Create a new project as described on https://reactnative.dev/docs/native-modules-setup:

npx create-react-native-library react-native-awesome-module
✔ What is the name of the npm package? … react-native-awesome-module
✔ What is the description for the package? … foo
✔ What is the name of package author? … f
✔ What is the email address for the package author? … [email protected]
✔ What is the URL for the package author? … http://www.bar.org
✔ What is the URL for the repository? … http://www.foo.com
✔ Which languages do you want to use? › Java & Swift
✔ What type of library do you want to develop? › Native module (to expose native APIs)

produces an Xcode project with swift-5 references:

grep -r swift-5 example/ios/ 
example/ios//AwesomeModuleExample.xcodeproj/project.pbxproj:			"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
example/ios//AwesomeModuleExample.xcodeproj/project.pbxproj:			"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",

Including a Pod with a os.Logger dependency leads to a linker error:

Undefined symbols for architecture arm64:
  "nominal type descriptor for os.Logger"

Removing the swift-5 paths fixes the build.

jmkolbe avatar May 23 '22 13:05 jmkolbe

The example project is generated by React Native CLI. So it seems like related to React Native itself. So please open an issue in React Native repo if this is a bug.

satya164 avatar Nov 24 '23 12:11 satya164