rn

1.rn的环境搭建(mac)

在iOS项目中添加rn

yarn add react-native

报错

Fetching packages...

error [email protected]: The engine "node" is incompatible with this module. Expected version ">=10". Got "8.12.0"

error Found incompatible module

info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

原因是自己的node 版本不是最新的

node的下载链接:https://nodejs.org/en/download/

直接下载安装

pod 'openssl' 失败解决方案

  • 第一种解决方法: 替换你的openssl 使用OpenSSL-Universal pod 'OpenSSL-Universal'
  • 第二种方法: 终端执行两面两个命令: sudo gem uninstall cocoapods-downloader sudo gem install cocoapods-downloader -v 1.2.0
  • 第三种方法: rm -r ${TMPDIR}/openssl/
  • 第四种方法(这种方法看个人情况): xcode -> preferences -> locations. 查看command line tools是否是空

亲测第一和第四种方式可行

编译出现'event2/event-config.h' file not found

经查阅是因为Flipper-Folly版本导致的,将Podfile 文件 修改如下

use_flipper! 修改为 use_flipper!({ 'Flipper-Folly' => '2.3.0' })

然后删除Podfile.lock,然后重新 pod install

在根目录下

grep -rl "s.dependency 'React/Core'" node_modules/ | xargs sed -i '' 's=React/Core=React-Core=g'

你可能感兴趣的:(rn)