question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatible with React Native Autolinking (React Native v0.60)

See original GitHub issue

Goals

Use the Realm.js with React Native Autolinking correctly.

Expected Results

Don’t show warning information.

Let the CocoaPods don’t show warning after executing pod install.

Actual Results

After the pod install, it shows the following warning:

[!] use_native_modules! skipped the react-native dependency 'realm'. No podspec file was found.
    - Check to see if there is an updated version that contains the necessary podspec file
    - Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good example of a package.json driven podspec. See
    https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
    - If necessary, you can disable autolinking for the dependency and link it manually. See
    https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library

Steps to Reproduce

cd ${REACT_NATIVE_PROJECT_ROOT_PATH}
npm install --save realm
cd ios && pod install & cd ..

Version of Realm and Tooling

  • Realm JS SDK Version: realm-js 2.29.1
  • Node or React Native: React Native v0.60.3
  • Client OS & Version: iOS 12.2
  • Which debugger for React Native: None

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:35
  • Comments:40 (9 by maintainers)

github_iconTop GitHub Comments

25reactions
blagoevcommented, Sep 4, 2019

Hey everyone. There are already plans to fix this soon.

6reactions
hpentimallicommented, Oct 18, 2019

I’m getting the same error as @excitedcat. Has anyone found a solution?

I’ve tried the solutions posted here, and manual linking works.

  1. Add a react-native.config.js config file in the root of the project with this content:
module.exports = {
    dependencies: {
        'realm': {
            platforms: {
                ios: null,
            },
        },
    },
}

That will skip autolinking for Realm for iOS.

  1. Add the project RealmReact.xcodeproj from node_modules into your project as a subproject

  2. Be sure to include libRealmReact.a in the Link Binary With Libraries step of your target Build Phases. Important: I’ve spent a lot of time chasing the Cannot read property 'debugHosts' of undefined bug because I was linking to libRealm.a and not libRealmReact.a, I’m sure that may happen to someone else.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not compatible with RN 0.60 autolinking - react native
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually: ...
Read more >
Blog - React Native
Today we are sharing an experimental cross-platform pointer API for React Native. We'll go over motivations, how it works, and its benefits to...
Read more >
react-native-community/datetimepicker - npm
React Native date & time picker component for iOS, Android and Windows. ... Autolinking is not yet implemented on Windows, ...
Read more >
React native upgrade to v0.61.2 - Emad Dehnavi - Medium
Add androidx suppport; Support RN60 AutoLinking; Using CocoaPods. Release page for react-native-fs.
Read more >
react-native | Yarn - Package Manager
React Native brings React's declarative UI framework to iOS and Android. ... v0.69.1. Changed. iOS specific. Make all Yoga headers public and add...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found