React-native-pdf iOS 和 Android 构建错误

Har*_*las 5 android ios react-native react-native-pdf

尝试在 iOS 和 Android 中创建构建。应用程序正在使用react-native-pdf库。出现构建错误

错误:无法从/Users/runner/work/1/s/node_modules/react-native-pdf/index.js解析模块react-native-blob-util:在以下位置中找不到react-native-blob-util项目或这些目录中:node_modules ../../node_modules

我们尝试将react-native-blob-util添加到package.json中。但现在由于react-native-blob-util,在 iOS 中出现重复符号构建错误

“react-native-blob-util”:“^0.13.16”,“react-native-pdf”:“^6.4.0”

小智 7

我也遇到这个案子,最好的方法是

  1. 卸载react-native-blob-util和react-native-pdf
npm uninstall react-native-blob-util
npm uninstall react-native-pdf
Run Code Online (Sandbox Code Playgroud)
  1. 安装react-native-pdf版本到6.2.0

npm install react-native-pdf@6.2.0

  1. 安装 rn-fetch-blob,或者如果您已经安装了

npm i rn-fetch-blob

  1. npm install