React Native 0.62 iOS Error: Undefined symbol: associated type descriptor for FloatLiteralType
Question
When upgrading React Native 0.61.5 to 0.62.2, the following error occurred during Xcode compilation.
Solution
There are two ways to solve this issue.
1. Refer to the official upgrade code
Refer to the official upgrade helper webtool, https://react-native-community.github.io/upgrade-helper/?from=0.61.5&to=0.62.2, and modify your project code. The main changes are ios/RnDiffApp.xcodeproj/project.pbxproj
and ios/Podfile
.
2. Follow these steps to setup Xcode
We should submit local files first, or back up.
2.1 Add Swift
Create a new swift file under the project.
Select Swift File, fill in any file name, in the Would you like to configure an Objective-C bridging header?
Pop-up box, select Don't Create .
Delete the swift file that has been created.
Press Move to Trash .
2.2 Add LIBRARY_SEARCH_PATHS
In Xcode, Select Procjet -> Build Settings -> Library Search Paths. Add these items as follow.
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)"
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"
"$(inherited)"
2.3 Setting Dead Code Stripping to YES
In Xcode, select PROJECT -> Build Settings -> LInking -> Dead Code Stringpping, and change to YES.
2.4 Add LD_RUNPATH_SEARCH_PATHS
In Xcode, select Procjet -> Build Settings -> Runpath Search Paths, add /usr/lib/swift $(inherited)
.
Finally, Clean Build Folder
and rebuild.