简体   繁体   中英

Building old version of React-Native app with Xcode 11

I just started working on an already existing React-Native app that needs a really small update, but that has not been updated since October 2019.

The first thing I need, in order to start updating it, is to build the app. That is where I cannot find a way to do it.

At the moment, I'm trying to build the app only on iOS and not on Android.

First of all the current toolset versions I'm using are:

React-Native version: 0.53.3
Xcode version: 11.4.1
iOS SDK: 13.4
Node version: 8.16.6
NPM version: 6.14.1

I initially had problem with third-party tools, but I managed to fix it through manually installing them in the node-modules/react-native folder .

Now I'm getting errors about Xcode not finding headers of the modules the app is using like, for example, React/RCTViewManager.h file not found Or, similarly, the GoogleSignIn.h headers in the RNGoogleSignIn module

I believe it's just an error of how libraries are imported in Xcode, because as a test I have created a new react-native “test app” with the same exact versions of react-native and node, then I installed the core dependencies needed to perform the update on the original app, and I managed to build it without problems.

I've also tested building the app on an old Mac with macOS 10.14, using Xcode 9, but I've got different errors, always related to importing headers of modules. This is the toolkits versions of the “old Mac”:

React-Native version: 0.53.3
Xcode version: 9.4.1
iOS SDK: 11.3
Node version: 8.16.6
NPM version: 6.14.1

Searching online I know that some of the problems I have faced (like the third-party react-native manual install) have been fixed in react-native updates, but I'm not expert enough with the technology to be sure that I can handle the update process without introducing bugs. I would prefer to just make this version run for now and facing the updating process later.

Do you have any suggestion of things about what I can do in order to successfully build the app?

If anyone ever comes here with a similar problem: the solution was pretty simple.

  1. Be sure you're using the .xcworkspace file in your iOS folder, and not the .xcodeproj . This is used to automatically (and correctly) load the Pods dependencies in Xcode without having to manually link them.
  2. Be sure that you installed the dependencies correctly with the right version of Cocoapods. We had to use an old version (1.5.x) that would automatically downloaded some pod dependencies. Our error was due to Facebook SDK. Newer versions of cocoapods did not download it, while the 1.5.x version would download it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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