React Native iOS build. Too long with no output (exceeded 10m0s): context deadline exceeded

I have been trying a lot to build my React native iOS app on circleCI through fastlane, but every time it gives above error after completing 95% of the build steps. I figured out this percentage by seeing logs and comparing those with my local build logs.

The configuration is

  • MacOS
  • XCode 16.2.0
  • React native app
  • Building for iOS
  • The build is being done through fastlane (build_app lane) and it is working fine on local Mac

The things I tried

  • Upgrading plan to $15 and choosing various Mac machines (as android build was also giving same error and after upgrading plan and using xLarge machine, the error went away and build was successful).
  • the iOS machines I tested are
  • m2pro.large, macos.m1.medium.gen1, macos.m1.large.gen1
  • Increasing the no_output_timeout to 20 minutes. It didn’t help, rather wasted more build times as process stopped after 8–9 minutes as earlier and was in same state for 20 minutes.

What I foresee is that the build process is killed unexpectedly, although logs show no such thing. Because, generally Xcode build keeps on populating logs every second and no output on console means archive is interrupted due to resource limitations or some other reason.

Below I have shared some logs from the ending of various builds, every time it stopped on a different step, ranging 90-95% of build task.

Output-1

[14:33:00]: ▸ Compiling RNSScreenNavigationContainer.mm
[14:33:00]: ▸ Compiling RNSScreenContainer.mm
[14:33:00]: ▸ Compiling RNSScreen.mm
[14:33:00]: ▸ Compiling RNSFullWindowOverlay.mm
[14:33:00]: ▸ Compiling RNSConvert.mm
[14:33:00]: ▸ Compiling RCTImageComponentView+RNSScreenStackHeaderConfig.mm
[14:33:00]: ▸ Touching RCTImage.framework (in target ‘React-RCTImage’ from project ‘Pods’)
[14:33:00]: ▸ Compiling RNScreens_vers.c

Too long with no output (exceeded 10m0s): context deadline exceeded

Output-2

[19:09:36]: ▸ Compiling FeaturesConfig.cpp
[19:09:36]: ▸ Compiling FabricUtils.cpp
[19:09:36]: ▸ Compiling EventHandlerRegistry.cpp
[19:09:36]: ▸ Compiling AnimatedSensorModule.cpp
[19:09:36]: ▸ Compiling RNReanimated_vers.c
[19:09:36]: ▸ Processing RNQuickAction-Info.plist
[19:09:36]: ▸ Touching react_native_version_number.framework (in target ‘react-native-version-number’ from project ‘Pods’)
[19:09:36]: ▸ Touching react_native_tracking_transparency.framework (in target ‘react-native-tracking-transparency’ from project ‘Pods’)
[19:09:38]: ▸ Processing RNQrGenerator-Info.plist
[19:09:38]: ▸ Touching MixpanelReactNative.framework (in target ‘MixpanelReactNative’ from project ‘Pods’)
[19:09:38]: ▸ Compiling RNQuickAction_vers.c

Too long with no output (exceeded 10m0s): context deadline exceeded

I can’t get to know why is it terminating without any errors. Searched alot but nothing found of help. Below is my fastlane command for reference

build_app(
scheme: options[:scheme],
workspace: “ios/redacted.xcworkspace”,
export_options: { method: “app-store” },
xcargs: “-verbose”
)

This is a bit of a shot in the dark, but I notice you’re using Xcode 16.2, which is still in beta. Does this still happen if you use 16.1?

I actually figured it out.

The issue was the incorrectly setup keychain on circleCI image. The logs don’t tell you this, and in fact the build part was successful, and the error came while checking certificates. But probably logs are lagging behind than actual build process so build process terminated and logs could not make up till the UI. That is the reason the logs stopped at around 95-100% of build process.

How I figured it out?
The detailed logs of xCode build are available at the path

/Users/distiller/Library/Logs/gym/your_target_name.log

Analyzing these logs suggested that the keychain was not setup. So I added this lane

setup_circle_ci

in my fastlane before starting archive and archive was successful.

For all those struggling with errors and if the logs on UI are not helpful, do take a look at the detailed log file. Trying searching for keywords like error in that long file.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.