EAS build failing library not found in Bare Workflow project with OneSignal

Hi all! :slight_smile:

I’m having some issues with using EAS to build my project. For context, my project has been ejected from Expo into the Bare Workflow, and I’ve integrated OneSignal push notifications. What’s more, I’m using an M1 Mac.

After running eas build --platform ios, I’m prompted to log into my Apple developer account where I let Expo handle the creation of profiles, certificates, and an Apple Push Notifications service key. However, after trying several times trying to create a successful TestFlight build, I get the following error from the build logs.

❌  ld: library not found for -lPods-OneSignalNotificationServiceExtension

62
❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)

63› Linking   myapp/OneSignalNotificationServiceExtension » OneSignalNotificationServiceExtension
64
❌  ld: library not found for -lPods-OneSignalNotificationServiceExtension

65
❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)

66▸ ** ARCHIVE FAILED **
67▸ The following build commands failed:
68▸ 	Ld /Users/expo/Library/Developer/Xcode/DerivedData/myapp-agzlgrbgaemfsgdzhutczrqowupq/Build/Intermediates.noindex/ArchiveIntermediates/myapp/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/OneSignalNotificationServiceExtension.build/Objects-normal/armv7/Binary/OneSignalNotificationServiceExtension normal armv7
69▸ 	Ld /Users/expo/Library/Developer/Xcode/DerivedData/myapp-agzlgrbgaemfsgdzhutczrqowupq/Build/Intermediates.noindex/ArchiveIntermediates/myapp/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/OneSignalNotificationServiceExtension.build/Objects-normal/arm64/Binary/OneSignalNotificationServiceExtension normal arm64
70▸ (2 failures)
71** ARCHIVE FAILED **
72
73
74The following build commands failed:
75	Ld /Users/expo/Library/Developer/Xcode/DerivedData/myapp-agzlgrbgaemfsgdzhutczrqowupq/Build/Intermediates.noindex/ArchiveIntermediates/myapp/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/OneSignalNotificationServiceExtension.build/Objects-normal/armv7/Binary/OneSignalNotificationServiceExtension normal armv7
76	Ld /Users/expo/Library/Developer/Xcode/DerivedData/myapp-agzlgrbgaemfsgdzhutczrqowupq/Build/Intermediates.noindex/ArchiveIntermediates/myapp/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/OneSignalNotificationServiceExtension.build/Objects-normal/arm64/Binary/OneSignalNotificationServiceExtension normal arm64
77(2 failures)
78Exit status: 65
79
80+-------------+-------------------------+
81|           Build environment           |
82+-------------+-------------------------+
83| xcode_path  | /Applications/Xcode.app |
84| gym_version | 2.178.0                 |
85| sdk         | iPhoneOS14.4.sdk        |
86+-------------+-------------------------+
87Looks like fastlane ran into a build/archive error with your project
88It's hard to tell what's causing the error, so we wrote some guides on how
89to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
90Before submitting an issue on GitHub, please follow the guide above and make
91sure your project is set up correctly.
92fastlane uses `xcodebuild` commands to generate your binary, you can see the
93the full commands printed out in yellow in the above log.
94Make sure to inspect the output above, as usually you'll find more error information there
95[stderr] [!] Error building the application - see the log above
96Error: Fastlane build failed with unknown error. Please refer to the "Run fastlane" and "Xcode Logs" phases.
Fastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.

Here’s the output after running expo diagnostics:

 Expo CLI 3.11.2 environment info:
  System:
   OS: macOS 11.5.2
   Shell: 3.2.57 - /bin/bash
  Binaries:
   Node: 15.10.0 - /usr/local/bin/node
   Yarn: 1.21.1 - /usr/local/bin/yarn
   npm: 7.5.6 - ~/.npm-global/bin/npm
   Watchman: 4.9.0 - /usr/local/bin/watchman
  IDEs:
   Android Studio: 4.1 AI-201.8743.12.41.6953283
   Xcode: 12.5/12E262 - /usr/bin/xcodebuild
  npmPackages:
   @sentry/react-native: ^3.1.0 => 3.1.0 
   expo: ^41.0.0 => 41.0.1 
   react: 16.13.1 => 16.13.1 
   react-native: ^0.64.2 => 0.64.2 
   react-navigation: ^4.0.10 => 4.0.10 
  npmGlobalPackages:
   expo-cli: 4.10.0

Here’s the output after running eas -v:

eas-cli/0.27.1 darwin-x64 node-v15.10.0

Unfortunately, even investigating the issue through the links provided by Fastlane, I’ve still have not been able to come to a resolution.

What may be the issue with how EAS and my project not being able to be built successfully?

Thanks in advance for the help! :slight_smile:

Hi

By the way, OneSignal is apparently working on a Config Plugin so that it can be used in the managed workflow. It seems they have it mostly working already: Expo config plugin · Issue #1252 · OneSignal/react-native-onesignal · GitHub

About your build problem: Are you able to clone your project, install the dependencies (with npm install or yarn) and then build locally with Xcode?

Hi Wodin, thanks for reaching out and helping. Yes, I’m able to to successfully clone my project, install all necessary dependencies using yarn, and run it locally with Xcode. The problem only comes when I’m trying to use EAS to make a TestFlight build.

OK, and when you built locally it was a release build?

No, it was a debug build. For some reason, when I try to locally do a release build, I get the same error:

ld: library not found for -lPods-OneSignalNotificationServiceExtension

1 Like

Ah, good. That narrows it down a bit.

Off hand it sounds like the library has not been added to Xcode correctly. Why that might be I am not sure. I have never tried to install OneSignal before.

Maybe you can go through the installation instructions again to see if anything didn’t work properly the first time round?

EDIT: The error message implies that the library path is missing in the Xcode configuration for your release build.

Hi Guys,

I am running into the same problem. Have you found a way to solve it?

1 Like

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