error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually

I managed to make the error go away by doing as follows:

  1. Create a react-native.config.js file in the root of your project.
  2. Update it to something like this:
// react-native.config.js
module.exports = {
  dependencies: {
    '<dependency>': {
      platforms: {
        android: null, // disable Android platform, other platforms will still autolink
      },
    },
  },
};

Source


Basically Autolinking is a replacement for react-native link. If you have been using React Native before version 0.60.

But you can also disable autolinking for unsupported library

During the transition period some packages may not support autolinking on certain platforms. To disable autolinking for a package, update your react-native.config.js's dependencies entry to look like this:

// react-native.config.js

module.exports = {
  dependencies: {
    'some-unsupported-package': {
      platforms: {
        android: null, // disable Android platform, other platforms will still autolink if provided
      },
    },
  },
};

For further clarification follow this link : https://github.com/react-native-community/cli/blob/master/docs/autolinking.md


I got this error "React Native CLI uses auto linking for native dependencies, but the following modules are linked manually". I then solve the error by removing those three dependencies, react-native-gesture-handler, react-native-reanimated and react-native-vector-icons from my IOS project with these three commands;

react-native unlink react-native-gesture-handler --platforms ios
react-native unlink react-native-reanimated --platforms ios
react-native unlink react-native-vector-icons --platforms ios

and then, $ cd ios and then ios/myproject$ pod install and then cd ..and then myproject$ npx react-native run-ios

Tags:

React Native