Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Failure with React Native and Rollbar Integration - ‘RollbarCrash’ Module Issues #202

Open
tawanorg opened this issue Oct 25, 2024 · 5 comments

Comments

@tawanorg
Copy link

Description

I'm encountering build failures when integrating Rollbar into a bare-minimum React Native project. The error seems to stem from the RollbarCrash module, causing build failures in both the terminal and Xcode workspace.

Steps to Reproduce:

  1. Create a new React Native project with the following configuration:
    • React Native version: 0.76.0
    • Rollbar version: 1.0.0-beta.4
  2. Install Rollbar dependencies by following the official Rollbar integration steps for React Native.
  3. Attempt to build the project using:
    • react-native run-ios in the terminal
    • Opening the .xcworkspace in Xcode and building from there.

Expected Behavior

The project should build successfully with Rollbar integrated.

Actual Behavior

The build fails after installing Rollbar. Below are the specific errors from Xcode:
Module ‘RollbarCrash.RollbarCrashThread’ requires feature ‘objc’ and more

This error is repeated multiple times for various symbols within RollbarCrash. The project builds without Rollbar installed, but after adding the Rollbar dependencies, neither the terminal nor Xcode will build the project successfully.

Please see the attached screenshots of the error messages in Xcode and the terminal for more details:

image (3)
image (2)
image (1)
image

Dependencies:

"dependencies": {
  "@rollbar/react": "^0.12.0-beta",
  "react": "18.3.1",
  "react-native": "0.76.0",
  "rollbar": "^2.26.4",
  "rollbar-react-native": "^1.0.0-beta.4"
}

Environment

  • Xcode version: 16
  • macOS version: 15.0.1
  • Node version: 20.15.1

Podfile Configuration:

platform :ios, '11.0'
use_frameworks! :linkage => :static

target 'AppName' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath]
  )

  # Rollbar dependencies
  pod 'RollbarReport'
  pod 'RollbarCrash', :modular_headers => true

  target 'YourAppNameTests' do
    inherit! :complete
  end

  post_install do |installer|
    react_native_post_install(installer)
  end
end
@tawanorg
Copy link
Author

Here is the demo repository https://github.com/tawanorg/react-native-with-rollbar

@matux
Copy link
Contributor

matux commented Oct 25, 2024

@tawanorg I'm looking into this right now, I'll try to get a fix asap. Thank you so much for this.

@matux
Copy link
Contributor

matux commented Oct 25, 2024

@tawanorg So, the problem here is two-fold:

  1. Don't define these pod dependencies separately:
  # Rollbar dependencies
  pod 'RollbarReport'
  pod 'RollbarCrash', :modular_headers => true

Cocoapods suggests this when using dynamic framework linkage, but the suggestion is wrong. So delete those two lines.

  1. Unlike the Podfile Configuration you shared in the issue, the Podfile in the repository you shared is not correctly defining static framework llinkage.
    You have to either do this explicitly by adding the use_frameworks! :linkage => :static line, or make sure the env var USE_FRAMEWORKS = 'static' is set.

@matux
Copy link
Contributor

matux commented Oct 25, 2024

@tawanorg Please refer to this comment for the solution: #199 (comment)

@matux
Copy link
Contributor

matux commented Oct 25, 2024

I'll close this issue as soon as you confirm you got things working on your side. Any other issue you're seeing, don't hesitate communicating, I'll do my best to fix things asap for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants