Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Build Fail After upgrading from 0.57.8 to 0.58.1 #23166

Closed
GoktuqCan opened this issue Jan 26, 2019 · 17 comments
Closed

iOS Build Fail After upgrading from 0.57.8 to 0.58.1 #23166

GoktuqCan opened this issue Jan 26, 2019 · 17 comments
Labels
Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@GoktuqCan
Copy link

GoktuqCan commented Jan 26, 2019

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
@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Jan 26, 2019
@JoeLeung32
Copy link

Share

Before upgrade to 0.58.1 (My RN: 0.57.7)

  • Backup your /ios/ or rename to /ios_old/ (as you like)

react-native eject
react-native-git-upgrade
react-native link

After linked

  • Compare all *.plist between /ios/ and /ios_old/ and cover the new one

react-native run-ios

  • Done

I can run perfect now, in /ReactCommon/ folder still missing /privatedata/. 😢

@kelset
Copy link
Contributor

kelset commented Jan 28, 2019

👋 there

we are currently trying to improve on the upgrading experience because the tool that you used (and linked in the docs) is sort-of been unmaintained for a while.

I know it's not ideal and we are working on this 💪 Can you, in the meantime, try to do the same procedure but instead using this repo as source for the diff (the git apply step)? https://github.com/pvinis/rn-diff-purge

@oferRounds
Copy link

Getting this error as well...

@GoktuqCan
Copy link
Author

GoktuqCan commented Jan 28, 2019

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

@oferRounds
Copy link

Thank you, just solved it for me as well :)

@kelset
Copy link
Contributor

kelset commented Jan 28, 2019

Ok, ty @GoktuqCan for the solution - closing.

@kelset kelset closed this as completed Jan 28, 2019
@toblerpwn
Copy link

toblerpwn commented Jan 31, 2019

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):

watchman watch-del-all
rm -rf $TMPDIR/react-*
rm -rf $TMPDIR/metro-*
rm -rf $TMPDIR/haste-*
rm -rf node_modules/
npm cache clean --force
rm -rf ios/Pods
rm -rf ios/build
rm -rf android/build

npm install
pod install
npm start -- --reset-cache

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!

@GoktuqCan
Copy link
Author

GoktuqCan commented Jan 31, 2019

Hi @toblerpwn i didn't use the react-native-git-upgrade used rn-diff-purge instead. If you upgrading from 0.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:

  1. Clear under /RNApp/ios/build/ folder
  2. Then run:
$ rm -rf node_modules && npm install
$ react-native run-ios -- --reset-cache

Hope this helps you.

@toblerpwn
Copy link

toblerpwn commented Feb 14, 2019

@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 and cmd-K both). I got this idea by reading this comment on a related issue: #23183 (comment)

image

I 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!

@NicholasBertazzonAga
Copy link

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

@motogod
Copy link

motogod commented Feb 21, 2019

If remove the folder ios/build that include some settings in info.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

@bmwertman
Copy link

I'm getting this same error building with Xcode and running react-native 0.57.8

@lvstross
Copy link

lvstross commented Mar 7, 2019

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.

  1. In the top menu, open 'Product' and click 'Clean Build Folder'.
  2. Open Xcode 'Preferences' and navigate to the 'Locations' tab on the top right.
  3. Under the 'Derived Data' input, there is a path in grey text and an arrow icon next to it. Click the arrow icon.
  4. This will take you to your DerivedData folder in finder.
  5. With this folder open, Quit Xcode completely.
  6. Back in finder, delete all the contents INSIDE the 'DerivedData' folder. Do not delete the folder itself.
  7. Re-open Xcode and try rebuilding your app.

Hope this helps

@Ankarrr
Copy link

Ankarrr commented Mar 19, 2019

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.

  1. In the top menu, open 'Product' and click 'Clean Build Folder'.
  2. Open Xcode 'Preferences' and navigate to the 'Locations' tab on the top right.
  3. Under the 'Derived Data' input, there is a path in grey text and an arrow icon next to it. Click the arrow icon.
  4. This will take you to your DerivedData folder in finder.
  5. With this folder open, Quit Xcode completely.
  6. Back in finder, delete all the contents INSIDE the 'DerivedData' folder. Do not delete the folder itself.
  7. Re-open Xcode and try rebuilding your app.

Hope this helps

It works for me. Thanks!

@robertoclavijob
Copy link

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.

1. In the top menu, open 'Product' and click 'Clean Build Folder'.

2. Open Xcode 'Preferences' and navigate to the 'Locations' tab on the top right.

3. Under the 'Derived Data' input, there is a path in grey text and an arrow icon next to it. Click the arrow icon.

4. This will take you to your DerivedData folder in finder.

5. With this folder open, Quit Xcode completely.

6. Back in finder, delete all the contents INSIDE the 'DerivedData' folder. Do not delete the folder itself.

7. Re-open Xcode and try rebuilding your app.

Hope this helps

I upgraded from 0.57.8 to 0.58.0, these steps allow me to build from Xcode, but still cannot build from the command line

@agm1984
Copy link

agm1984 commented Apr 20, 2019

I was having issues in iOS after upgrading from 0.56 to 0.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, deleting Podfile.lock (with specific problem with Folly (and loosely related was glog 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 remove android/build and ios/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:

  • kill metro bundler, and use npm start -- --reset-cache
  • remove your iOS app off the simulator
  • remove your Android app off the simulator
  • turn off and/or restart your simulators as you upgrade because they might be using something like iPhone 6 or 8 while the RN config is trying to use iPhone X (that might generate weird errors for you)
  • you may encounter issues with Google Play Services and stuff like that as you update your project to handle JSC
  • you might have issues with Android SDK and Gradle if you upgraded them (they change a bit from 0.56 to 0.59 as can be checked here in the diffs: https://github.com/react-native-community/rn-diff-purge)
  • start with a working RN version that allows you to build all your app's third party dependencies on the simulator and preferably to make APK/IPA releases also (just so you know where it was working)
  • add the diffs as shown in that above URL, upgrade manually one version at a time and at least periodically check your simulators to make sure the app is still working
  • I encountered a lot of issues going from 0.56 to 0.57 or 0.58 because my Android/gradle stuff changed a lot and broke my release builds via cd android && ./gradlew assembleRelease
  • iOS seemed to have issues around 0.58 to 0.59 and especially for me because I am using react-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.

@charlesfong
Copy link

react-native-git-upgrade

Share

Before upgrade to 0.58.1 (My RN: 0.57.7)

  • Backup your /ios/ or rename to /ios_old/ (as you like)

react-native eject
react-native-git-upgrade
react-native link

After linked

  • Compare all *.plist between /ios/ and /ios_old/ and cover the new one

react-native run-ios

  • Done

I can run perfect now, in /ReactCommon/ folder still missing /privatedata/. 😢

worked perfectly Thanksss!!! <3

@facebook facebook locked as resolved and limited conversation to collaborators Jan 28, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests