react-native: iOS Build Fail After upgrading from 0.57.8 to 0.58.1
Environment
React Native Environment Info:
System:
OS: macOS 10.14.2
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 138.55 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.1.0 - /usr/local/bin/node
npm: 6.6.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: ^0.58.1 => 0.58.1
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
react-native-rename: 2.4.0
Description
I started project with version v0.57.8 I followed instruction here for upgrading to v0.58.1: https://facebook.github.io/react-native/docs/upgrading#upgrade-based-on-git After upgrading, Android app wasn’t responding to touches but after deleting and re-installing node_modules, plus --reset-cache it’s solved.
But on iOS build i still get this error(both on run-ios and Xcode):
PBXCp /.../RNApp/node_modules/react-native/ReactCommon/privatedata/PrivateDataBase.h /.../RNApp/ios/build/Build/Products/Debug-iphonesimulator/include/privatedata/PrivateDataBase.h (in target: privatedata)
cd /.../RNApp/node_modules/react-native/React
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /.../RNApp/node_modules/react-native/ReactCommon/privatedata/PrivateDataBase.h /.../RNApp/ios/build/Build/Products/Debug-iphonesimulator/include/privatedata
error: /.../RNApp/node_modules/react-native/ReactCommon/privatedata/PrivateDataBase.h: No such file or directory
** BUILD FAILED **
The following build commands failed:
PBXCp /.../RNApp/node_modules/react-native/ReactCommon/privatedata/PrivateDataBase.h /.../RNApp/ios/build/Build/Products/Debug-iphonesimulator/include/privatedata/PrivateDataBase.h
(1 failure)
Reproducible Demo
$ react-native init --version 0.57.8 Dummy
$ react-native-git-upgrade
$ git apply $TMPDIR/react-native-git-upgrade/upgrade_0.57.8_0.58.1.patch
$ rm -rf node_modules && npm install
$ react-native run-ios -- --reset-cache
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 11
- Comments: 17
Ok, I think i found the solution. When i searched for files those include “PrivateDataBase.h” they all were under the /RNApp/ios/build folder. I think they are precompiled files for faster further builds and i guess they are safe to delete because build/ folder included in .gitignore file provided by react native.
Solution: Clear under /RNApp/ios/build/ folder and re-run
react-native run-ios -- --reset-cache
I was having the same error
/node_modules/react-native/ReactCommon/privatedata/PrivateDataBase.h: No such file or directory
and this is how I fixed it.Hope this helps
Hi @toblerpwn i didn’t use the
react-native-git-upgrade
used rn-diff-purge instead. If you upgrading from0.57.8
here is link to compare: 0.57.8-to-0.58.3 Difference not that much you could make changes yourself less than 10 minutes. After that:Hope this helps you.
Share
Before upgrade to 0.58.1 (My RN: 0.57.7)
react-native eject
react-native-git-upgrade
react-native link
After linked
react-native run-ios
I can run perfect now, in /ReactCommon/ folder still missing /privatedata/. 😢
For anyone who’s still searching for a solution after trying all those above.
I resolved doing this:
cd node_modules/react-native && scripts/ios-install-third-party.sh && cd third-party/glog-0.3.5/ && ../../scripts/ios-configure-glog.sh
I am also having this issue after
react-native-git-upgrade
; the steps above did not work for a RELEASE archive, but they do for a DEBUG archive, fwiw (different schemes in Xcode). I suspect the problem could be therein (perhaps some Xcode tomfoolery that was not resolved correctly by the upgrade command line tool).Here are my “cleaning” steps (which did not fix the problem):
I am reverting back to 0.57.8 for now. I’ll try to get back on 0.58.x at some point using a different upgrade path!
I was having issues in iOS after upgrading from
0.56
to0.59.5
~. I was getting different errors between the CLI and Xcode 10, which eventually pointed towards JavaScriptCore (JSC) (which makes sense given 0.59 and JSC breaking changes). My “final boss” on the upgrade problem-set that de-clogged the iOS system is described via the following set of steps I wrote here:https://stackoverflow.com/questions/50562596/library-not-found-for-ldoubleconversion/55776414#55776414
I was able to fix it by blowing out the
ios/build
folder, deletingPodfile.lock
(with specific problem withFolly
(and loosely related wasglog
but there were some red herring debug pathways there), upgrading cocoapods seemed to fix the problem caused by React Native trying to rely on stale packages where syntax was probably different, or where JSC-critical API was missing.After that, I now boil it down to some caching/lock problem stemming from breaking changes in RN 0.57 to -0.59 caused by React Native baking in JSC. If you are having issues upgrading to around
RN 0.59
, you will most likely find that you need to removeandroid/build
andios/build
folders and focus a bit on refreshing every part of the build system that might be relying on old files.Here is a rough checklist to get your mind flowing:
npm start -- --reset-cache
0.56
to0.57 or 0.58
because my Android/gradle stuff changed a lot and broke my release builds viacd android && ./gradlew assembleRelease
0.58
to0.59
and especially for me because I am usingreact-native-maps
which generated all kinds of issues as JSC config files were changed to support 64bit CPU architectures and RN 0.59; some third party dependencies seemed to really have an issue with that if their versions were locked in and stale because they weren’t supporting JSC.If you discover your issues sound similar to mine and you learned about anything I didn’t describe, feel free to include a comment and describe a bit about how it relates to JSC and what you did to fix it. This will help others in the future that find this thread while Googling.
It works for me. Thanks!
If remove the folder
ios/build
that include some settings ininfo.plist
sometimes.So just remove the folder
Build
(the path is ios/build/Build)then
react-native run-ios
will fix the problem.That’s what I try. Hope it can helps others
@GoktuqCan I re-upgraded using
rn-diff-purge
, and yet I encountered the same problem!I think the missing step for me was to actually open Xcode and clean the build folder using the Xcode menu (although I used
cmd-option-K
andcmd-K
both). I got this idea by reading this comment on a related issue: https://github.com/facebook/react-native/issues/23183#issuecomment-458071519I did also actually run the build from Xcode, too (prior to this I was only building RELEASE using
fastlane
). Perhaps simply running a release build from within Xcode un-cached something, too!