Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

This error came up after upgrading to React Native 0.60.

I've tried to manually unlink each manually linked dependency using react-native unlink <dependency> as suggested in the error message, but the problem still persists.

The error message is as follows:

error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:   - react-native-admob (to unlink run: "react-native unlink react-native-admob")   - react-native-facebook-account-kit (to unlink run: "react-native unlink react-native-facebook-account-kit")   - react-native-fbsdk (to unlink run: "react-native unlink react-native-fbsdk")   - react-native-gesture-handler (to unlink run: "react-native unlink react-native-gesture-handler")   - react-native-linear-gradient (to unlink run: "react-native unlink react-native-linear-gradient")   - react-native-localization (to unlink run: "react-native unlink react-native-localization")   - react-native-restart (to unlink run: "react-native unlink react-native-restart")   - react-native-vector-icons (to unlink run: "react-native unlink react-native-vector-icons")   - react-native-webview (to unlink run: "react-native unlink react-native-webview") This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers. Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md 
like image 494
naderabdalghani Avatar asked Jul 07 '19 12:07

naderabdalghani


1 Answers

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

like image 142
naderabdalghani Avatar answered Sep 18 '22 15:09

naderabdalghani