Skip to content

_RCTSetLogFunction build failure in release mode fixed with Dead Code Stripping = No #25745

@elicwhite

Description

@elicwhite

I created a new project with 0.60.4. I was able to build and deploy the app to my physical iOS device with Debug scheme. I wanted to build for release by following the instructions here: https://facebook.github.io/react-native/docs/running-on-device

Specifically this line "go to Product → Scheme → Edit Scheme. Select the Run tab in the sidebar, then set the Build Configuration dropdown to Release."

After making that change I tried building a release mode version of the app to my device and the build failed with:

Undefined symbol: _RCTSetLogFunction

I found this stack overflow article that says

in the "Linking" section, find"Dead Code Stripping" section and change it "No"

This change made the build pass successfully.

It looks like this is a common problem that has been around for a long time. It would be great to either change the default or figure out how to keep this code from being dead code eliminated.

System:
OS: macOS 10.14.5
CPU: (4) x64 Intel(R) Core(TM) i5-4258U CPU @ 2.40GHz
Memory: 273.86 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm
Watchman: 4.7.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
IDEs:
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.4 => 0.60.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugRan CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions