react-native-community / upgrade-support

A central community-backed place to request and give help when upgrading your app.
MIT License
254 stars 2 forks source link

RN [0.61.3 to 0.62.2] - After Flipper Installation - XCode 11: 'cstdarg' file not found Could not build module 'Darwin' Could not build module 'Foundation' etc. #79

Open satputepritamcts opened 4 years ago

satputepritamcts commented 4 years ago

Environment

System: OS: macOS Mojave 10.14.6 CPU: (4) x64 Intel(R) Core(TM) i5-4308U CPU @ 2.80GHz Memory: 102.59 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 10.19.0 - /usr/local/opt/node@10/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.13.4 - /usr/local/opt/node@10/bin/npm Watchman: 4.9.4 - /usr/local/bin/watchman Managers: CocoaPods: 1.9.3 - /Users/pritam/.rbenv/versions/2.7.1/bin/pod SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 Android SDK: API Levels: 25, 28, 29 Build Tools: 27.0.3, 28.0.3, 29.0.2 System Images: android-28 | Google APIs Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 3.2 AI-181.5540.7.32.5056338 Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild Languages: Java: 1.8.0_191 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.11.0 => 16.11.0 react-native: 0.62.2 => 0.62.2 npmGlobalPackages: react-native: Not Found

Upgrading version

Upgraded from V 0.61.3 to 0.62.2

Description

After upgrading to react native 0.62.2 , Added Flipper dependency in Podfile. Pods are getting installed successfully. I have followed all the steps from this link https://github.com/react-native-community/upgrade-support/issues/13

Error: I'm getting errors when trying to build the project in XCode 11: 'cstdarg' file not found Could not build module 'Darwin' Could not build module 'Foundation' etc.

Screenshot 2020-06-02 at 4 13 53 PM copy

Reproducible demo

neiker commented 4 years ago

I'm facing same error migrating from 0.61.5 to 0.62.2 this are my dependencies:

"@mapbox/geo-viewport": "0.4.0",
"@mapbox/polyline": "1.0.0",
"@react-native-community/async-storage": "1.7.1",
"@react-native-community/geolocation": "2.0.2",
"@react-native-community/masked-view": "0.1.6",
"@react-native-community/netinfo": "5.3.3",
"@react-native-firebase/analytics": "6.7.1",
"@react-native-firebase/app": "6.7.1",
"@react-native-firebase/crashlytics": "6.7.1",
"axios": "0.19.2",
"axios-auth-refresh": "2.2.3",
"base-64": "0.1.0",
"lodash.debounce": "4.0.8",
"lodash.orderby": "4.6.0",
"lodash.throttle": "4.1.1",
"lodash.uniqby": "4.7.0",
"lottie-ios": "3.1.3",
"lottie-react-native": "3.3.2",
"moment": "2.24.0",
"moment-holiday": "1.5.1",
"moment-timezone": "0.5.27",
"polylabel": "1.0.2",
"prop-types": "15.7.2",
"qs": "6.6.0",
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-android-keyboard-adjust": "1.2.0",
"react-native-android-open-settings": "1.3.0",
"react-native-config": "0.11.7",
"react-native-date-picker": "2.7.10",
"react-native-device-info": "5.5.3",
"react-native-gesture-handler": "1.6.1",
"react-native-haptic": "1.0.1",
"react-native-linear-gradient": "2.5.6",
"react-native-map-link": "2.7.3",
"react-native-maps": "0.26.1",
"react-native-ntp-client": "1.0.1",
"react-native-picker-select": "6.3.3",
"react-native-reanimated": "1.7.0",
"react-native-safe-area-context": "3.0.2",
"react-native-screens": "2.0.0-alpha.25",
"react-native-share": "3.0.0",
"react-native-svg": "10.1.0",
"react-native-udp": "3.1.0",
"react-native-webview": "8.0.3",
"react-navigation": "4.0.10",
"react-navigation-animated-switch": "0.4.1",
"react-navigation-stack": "2.0.15",
"reanimated-bottom-sheet": "1.0.0-alpha.19",
"supercluster": "6.0.1",
"uuid": "3.3.3"
neiker commented 4 years ago

In my case is related to react-native-config

imagen
satputepritamcts commented 4 years ago

@neiker you can try below code under post_install script in Podfile

installer.pods_project.targets.each do |target|
    if target.name == 'react-native-config'
      phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
      phase.shell_script = "cd ../../"\
      " && RNC_ROOT=./node_modules/react-native-config/"\
      " && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\
      " && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby"

      target.build_phases << phase
      target.build_phases.move(phase,0)
    end
  end
neiker commented 4 years ago

@satputepritamcts I just tried that and still failed with the same error. Thank you anyway.

maxfurman commented 4 years ago

I am also seeing this issue when upgrading from 0.60.6 to 0.62.2. I also followed the steps in #13 . Perhaps some Xcode setting is incorrect? I'm not sure where cstdarg is supposed to live, but I assume we can tell the compiler to look for it wherever that is.

stanislav-sidorov commented 4 years ago

try to link dependency with react-native link react-native-config and clean project with shift+command+K, i had exactly the same errors, hope it help

isidoro-giffgaff commented 4 years ago

Hello @satputepritamcts, were you able to resolve this issue?

tiu-hans commented 4 years ago

Hi @satputepritamcts, @isidoro-giffgaff or @neiker, were you able to resolve this issue?

claudioviola commented 3 years ago

Same here

rafaeltakahashi commented 3 years ago

I don't know if this will work for others, but in my case the problem stopped after I manually edited my pbxproj file (inside the .xcodeproj directory) to remove the HEADER_SEARCH_PATHS fields (which is different than having it present with a value of ""). I had edited this field in the past, and I suppose that prevents Xcode from using the default values generated when installing pods (I'm not sure).

I'm sharing what I found as a reproducible demo:

shortcarver commented 3 years ago

^^ worked for me. Thanks!

satputepritamcts commented 3 years ago

Now getting error as below Could not build Objective-C module 'FlipperKit' for code - import FlipperKit

naquilini commented 3 years ago

Hi all,

I'm having the same issue when upgrading from react-native 0.61.4 to 0.63.4. I'm using xCode 12.2. I thought it was related to react-native-config, but then I tried the following: I comment in the Podfile the following lines: ... # use_flipper! post_install do |installer| # flipper_post_install(installer) ...

Now the project builds but once the app starts in the simulator, it gets stuck on a white screen. The last message I see in the debug log is the following: "Failed to mount LogBox within 1s"

Has anybody else experienced this? I already tried the solution suggested here, but no success.

MikePendo commented 2 years ago

Having the Same issue after upgrading from 63 to 64 Solved it by: 1.Setting Dead Code Stripping to YES (in TARGET )

  1. In Header Search Path made "${PODS_ROOT}/Headers/Public" - non recursive WTF
sky1412001 commented 1 month ago
Screenshot 2024-07-24 at 10 16 46 AM