1

Weird-Ass Linking-Related Bug

When I try to make an archive build in Xcode 10.3

Environment info

  • RN: 0.59.3
  • Xcode: 10.3
  • React Native Gesture Handler (RNGH): 1.4.1
  • React-Navigation: 3.11.0

React Native info output:

...
/Users/me/Library/Developer/Xcode/DerivedData/MyApp-somehash/Build/Intermediates.noindex/ArchiveIntermediates/appId/BuildProductsPath/Release-iphoneos/libRNGestureHandler.a -lPods-appId -lRNFirebase -lAppCenterReactNative -lAppCenterReactNativeAnalytics -lAppCenterReactNativeCrashes -Xlinker -dependency_info -Xlinker
...
clang: error: no such file or directory: '/Users/me/Library/Developer/Xcode/DerivedData/MyApp-somehash/Build/Intermediates.noindex/ArchiveIntermediates/appId/BuildProductsPath/Release-iphoneos/libRNGestureHandler.a'
Command Ld failed with a nonzero exit code

Steps To Reproduce

After installing (if I remember correctly) Microsoft's App Center tools (although it could have been React Navigation), I noticed my archive builds started failing with the uncategorized error above. The strange thing is that It seems to work fine when I run the build in a simulator or on my iPhone.

What I've tried so far:

Full environment info from package.json:

"dependencies": {
    "@react-native-community/blur": "^3.3.1",
    "appcenter": "2.0.0",
    "appcenter-analytics": "2.0.0",
    "appcenter-crashes": "2.0.0",
    "expo-keep-awake": "^5.0.1",
    "expo-localization": "^5.0.0",
    "i18n-js": "^3.2.2",
    "moment": "^2.24.0",
    "react": "16.8.3",
    "react-native": "0.59.3",
    "react-native-code-push": "^5.6.0",
    "react-native-config": "^0.11.7",
    "react-native-elements": "^1.1.0",
    "react-native-firebase": "^5.4.3",
    "react-native-gesture-handler": "^1.3.0",
    "react-native-maps": "^0.24.2",
    "react-native-paper": "^2.16.0",
    "react-native-snap-carousel": "^3.8.0",
    "react-native-unimodules": "^0.4.0",
    "react-native-vector-icons": "^6.5.0",
    "react-navigation": "^3.11.0",
    "react-redux": "^7.0.3",
    "redux": "^4.0.1",
    "redux-persist": "^5.10.0",
    "redux-starter-kit": "^0.5.1",
    "redux-thunk": "^2.3.0"
}
Ryan Unger
  • 19
  • 6

2 Answers2

1

There is issue with xcode 10.2 and xcode 10.3 while archiving,we faced the same issue Xcode issue

I raised a ticket to Apple support but didn't get any response. Try to archive the same with xcode 10.1.It will solve your problem.

Pawan Kumar
  • 508
  • 3
  • 19
-1

We still have no idea about the exact root cause, but our best guess is that this issue might be related to us using RN 0.59.3, and some of our packages preparing themselves for RN 0.60.

Either way, we did get the build to work!

The fix for us was starting a brand new project using RN 0.60 and then installing each required package one-by-one. Although this approach was time-consuming, it seemed to work well, as we've been able to recreate the app and build successfully.

p.s. We added App Center once we got react-native-gesture-handler working with both react-native-maps and react-navigation. This way it became much easier to watch our builds in CI and make sure everything remained stable.

Ryan Unger
  • 19
  • 6