升级后出现此错误,以响应Native0.60。
我试图按照错误消息中的建议,使用react-native unlink <dependency>手动解除每个手动链接的依赖项,但问题仍然存在。
错误消息如下:
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发布于 2019-07-07 13:00:20
我通过如下操作成功地消除了错误:
// react-native.config.js
module.exports = {
dependencies: {
'<dependency>': {
platforms: {
android: null, // disable Android platform, other platforms will still autolink
},
},
},
};发布于 2020-08-28 08:59:58
我得到了这个错误"React对本机依赖项使用自动链接,但是下面的模块是手动链接的“。然后,我用这三个命令从我的IOS项目中删除了这三个依赖项,即react本机-手势-处理程序、react本机-还原和react本机向量-图标,从而解决了错误;
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然后,$ cd ios,ios/myproject$ pod install,cd ..,myproject$ npx react-native run-ios
发布于 2019-07-16 04:21:24
基本上,自动链接是对反应本机链接的替代。如果您在0.60版本之前使用了Reacti原住民。
,但对于不支持的库,也可以禁用自动收费。
在过渡时期,一些软件包可能不支持某些平台上的自动收费。若要禁用包的自动收费,请将react native.config.js的依赖项更新如下:
// react-native.config.js
module.exports = {
dependencies: {
'some-unsupported-package': {
platforms: {
android: null, // disable Android platform, other platforms will still autolink if provided
},
},
},
};要进一步澄清,请参阅以下链接:https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
https://stackoverflow.com/questions/56922180
复制相似问题