Change a new Mac, re-build the iOS terminal RN development environment, encountered some pits, record.

Error message 1:

[!]  Invalid `Podfile` file: undefined method `[]' for nil:NilClass. # from /Users/marcel/Projekte/WerBinIch/ios/Podfile:43 # ------------------------------------------- # > use_native_modules! # end # -------------------------------------------Copy the code

Error: Use_native_modules is in the Podfile of iOS project. NPM is used to install the RN library. The error will be reported after link is used. The error will not be reported when yarn is used to install the library.

Solution: Use YARN instead of NPM.

Error message 2:

TypeError: null is not an object (evaluating '_RNGestureHandlerModule.default.Direction')
Copy the code

Error cause: Use YARN to install the package library and use NPM to install a specific library. Some libraries are incorrectly installed if the two installation commands are used together. One of them is react-native mouth-handler.

Solution: Do not use the yarn command.

Error message 3:

[!] No podspec found for 'GrowingReactNativeKit' in./node_modules/react-native-growingio errorCopy the code

Cause: An incorrect library is installed on Github because there are multiple libraries with the same name.

Solution: Specify the library name and version number. For example: yarn add https://github.com/growingio/react-native-growingio.git#0.0.7

Error message 4:

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
Copy the code

Error cause: Wall

Solution: DNS is a wall, but can use the IP address, the IP address of the corresponding query raw.githubusercontent.com domain name, first directly to the local hosts file. Tutorial: www.jianshu.com/p/c2e829027…

Error message 5 is displayed

Android keeps reporting errors:

unrecognized operator abs
Copy the code

Error: The react-native reanimated library version is incorrect. ^1.7.0 is used.

Solution: Remove the ‘^’ in front of the version number, that is, use the specified version 1.7.0.