react-native-device-info: Linker fails with ld: library not found for -lRNDeviceInfo

Summary

Version 0.21.4
Affected OS MacOS Sierra
OS Version 10.12.6

Current behavior

when building the project for release:

xcodebuild "-project" "ios/FleetFox.xcodeproj" "-scheme" "FleetFox" "-configuration" "Release" "archive" "-verbose" | xcpretty

The linker fails with:

ld: library not found for -lRNDeviceInfo

Expected behavior

It should build without errors. Downgrading the package to 0.21.1 fixes the problem.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 20
  • Comments: 18

Commits related to this issue

Most upvoted comments

just the usual rn fuckery

I got the same problem when I updated to the latest version. You can fix it by opening to project in xcode. And navigate to the library folder in the left panel of your xcode. And then remove the old DeviceInfo.xcodeproj and add it manually from the related node_modules.

In XCode, in the project navigator:

Right click Libraries Add Files to [your project’s name] Go to node_modules/react-native-device-info Add the .xcodeproj file

  1. Xcode -> Open project -> remove Libraries/RNDeviceInfo.xcodeproj
  2. react-native link react-native-device-info

This is due to the change made in #374. Sorry for the inconvenience folks, I’ll add a new entry in the troubleshooting section.

my xcode doesn’t allow me to select the .xcodeproj file, but only the upper ios folder…

image

image