简体   繁体   English

如何修复 React-Native@0.59.9 IOS Build 中的错误

[英]How to fix error in React-Native@0.59.9 IOS Build

I want to use epubjs-rn library.我想使用 epubjs-rn 库。 [link:https://github.com/futurepress/epubjs-rn] [链接:https://github.com/futurepress/epubjs-rn]

So, I set up all libraries just like that epubjs-rn.所以,我像那个 epubjs-rn 一样设置了所有库。

when I downgrade react-native version 0.59.9, it makes errors当我降级 react-native 版本 0.59.9 时,它会出错

1. 1.

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening ViewerTest.xcworkspace

Invalid Podfile file: cannot load such file -- /myPath/node_modules/react-native/scripts/react_native_pods无效Podfile文件:无法加载此类文件 -- /myPath/node_modules/react-native/scripts/react_native_pods

I try to fix it.我尝试修复它。

1. React Native - pod install issue "cannot load such file.......node_modules/react-native/scripts/react_native_pods" 1. React Native - pod 安装问题“无法加载此类文件.......node_modules/react-native/scripts/react_native_pods”

  1. delete code in ios/podfile delete code in ios pod file删除 ios/podfile中的代码 删除 ios pod 文件中的代码

my package.json is我的 package.json 是

  {
  "name": "ViewerTest",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@lightbase/react-native-orientation": "^3.2.1",
    "@react-native-community/async-storage": "^1.5.0",
    "epubjs-rn": "^0.1.5",
    "metro": "^0.67.0",
    "react": "^16.8.3",
    "react-native": "^0.59.9",
    "react-native-static-server": "^0.5.0",
    "react-native-webview": "^5.12.0",
    "react-native-zip-archive": "^4.1.1",
    "rn-fetch-blob": "^0.10.15"
  },
  "devDependencies": {
    "@babel/core": "^7.17.0",
    "@babel/runtime": "^7.17.0",
    "@react-native-community/eslint-config": "^3.0.1",
    "babel-jest": "^27.5.0",
    "eslint": "^8.8.0",
    "jest": "^27.5.0",
    "metro-react-native-babel-preset": "^0.67.0",
    "react-test-renderer": "17.0.2"
  },
  "jest": {
    "preset": "react-native"
  }
}

When I install react-native@0.59.9, there is no podfile in ios directory我安装react-native@0.59.9时,ios目录下没有podfile

my Xcode version is 12.5.1:(我的 Xcode 版本是 12.5.1:(

plz help me and sorry about that i'm not good at english.请帮助我,对不起,我不擅长英语。

thanks !谢谢 !

I faced this issue with React Native version 0.61.2 and this worked for me.我在 React Native 版本 0.61.2 中遇到了这个问题,这对我有用。 Navigate to the ios folder of the app and run the command pod install Once that is done, go back to the root directory and run react-native run-ios导航到应用程序的 ios 文件夹并运行命令pod install完成后,go 回到根目录并运行react-native run-ios

OR或者

cd ios
rm -rf build/
pod install
cd ..

Try these solutions.试试这些解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM