0

After updating a react-native version, have got some issues while trying to npm run ios.

This is a problem what I've got:

enter image description here

enter image description here

What I Tried:

I have installed cocoapods, done pod deintegrate, done pod update also I have done pod repo update. I tried to delete and reinstall node_modules. But errors are the same.

While running a pod install, I have got this: enter image description here

The output of react native doctor:

enter image description here

here is what i have when running in xcode:

enter image description here enter image description here enter image description here enter image description here

react native info enter image description here

content of pod file: enter image description here

Ian
  • 77
  • 1
  • 9

2 Answers2

1

Upgrading to a new RN version can be quite tricky sometimes. An easy way to do it is to just use this helper. You put your old (current) version number into the left textbox on the helper website, and then you also put your new version that you want to upgrade to into the textbox on the right, before clicking the 'Show me how to upgrade!' button.

So in your case what I would suggest you do is to use this helper as a guide for your particular scenario, using your old version and the new one that is giving you the errors. Once you click on the button, it will show you exactly which changes you need to make in order for your project to build successfully. Then you can compare what you have already tried to the guide, perhaps you missed something somewhere.

instanceof
  • 1,404
  • 23
  • 30
  • He is using expo so `expo upgrade` works in most cases when there is not react-native version change. – Rajendran Nadar Jul 24 '21 at 21:10
  • But he mentioned nothing about Expo or `expo upgrade` anywhere in his question though... – instanceof Jul 24 '21 at 21:12
  • You can see uni-modules in the podfile, so it is expo bareworkflow application – Rajendran Nadar Jul 24 '21 at 21:13
  • If it is Expo's bare workflow, then he can still use the RN upgrade helper in my answer. In fact, that is exactly what I use to upgrade my Expo bare workflow app. – instanceof Jul 24 '21 at 21:17
  • By the way, the library you are referring to, [expo-file-system](https://www.npmjs.com/package/expo-file-system) can be used and installed on even non Expo RN apps. It is possible to install Expo libraries as npm packages, just like you would any other npm library. – instanceof Jul 24 '21 at 21:21
0

This is what you need to do

  1. cd ios

  2. pod install --repo-update or pod repo update

  3. pod install

Or to simplify it with a single cmd you can use npx pod-install repo update && npx pod-install

The pod install should run successfully. This happened to me after installing a package & running npx pod-install

I just got this error in one of the projects the above steps solved my issue. Try this and let me if any issues.

Rajendran Nadar
  • 4,962
  • 3
  • 30
  • 51
  • Now I have only this problem `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` – Ian Jul 24 '21 at 19:38
  • To fix that use `sudo xcode-select -switch /Applications/Xcode.app/` Make sure the path is correct I am assuming Xcode.app is inside the applications folder because it is the default path until you change it. – Rajendran Nadar Jul 24 '21 at 19:46
  • the same result:( – Ian Jul 24 '21 at 19:50
  • This is a new project? The version of react native? Did you try to unlink all the packages using `yarn react-native unlink `? Any issue with doctor cmd for ios? Try to build the app through xcode – Rajendran Nadar Jul 24 '21 at 19:55
  • Also try to restart the pc sometimes it works, happens with me also. – Rajendran Nadar Jul 24 '21 at 19:56
  • have updated a question with xcode run info & react native info – Ian Jul 24 '21 at 19:58
  • the project is not new – Ian Jul 24 '21 at 19:58
  • and how do i know which packages do i have to unlink? – Ian Jul 24 '21 at 20:00
  • If RN is above v0.60 unlink all that supports auto-linking, if there is any build folder inside the ios folder delete it & also try deleting the derived data folder of the project. – Rajendran Nadar Jul 24 '21 at 20:04
  • how do i know which supports autolinking and which is not? – Ian Jul 24 '21 at 20:07
  • so you mean, i have to unlink from every dependency i have in a packga json? – Ian Jul 24 '21 at 20:17