无法识别的命令“链接”在链接反应本机中的字体时

发布于 2025-02-13 00:59:42 字数 104 浏览 0 评论 0 原文

尝试在React Native Project中链接自定义字体,当使用NPX React-Native链接时,我会发现一个错误,说未识别的命令“链接”

是否有一种解决此问题的方法?

Trying to link custom fonts in a react native project, when using npx react-native link I get an error saying Unrecognized command "link"

Is there a way to resolve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

流心雨 2025-02-20 00:59:42

由于自动链接,链接和UNLINK命令已在

所以,请尝试以下操作:

npx react-native-asset

Due to autolinking, link and unlink commands have been removed in React Native 0.69.

So, please try this:

npx react-native-asset
命比纸薄 2025-02-20 00:59:42

手动链接已从React-Native 0.69中删除,有利于自动链接功能,因此现在您可以在本机模块中链接您的资产,否则您可以使用
react-nortiative-asset

剩下的步骤与板条箱中的crate相同

react-native.config.js

module.exports = {
    project: {
        ios: {},
        android: {}
    },
    assets: ['./src/assets/'],
};

安装下面的React-Native-Asset运行下方

yarn react-native-asset or npx react-native-asset

manual linking has been removed from react-native 0.69 in favour of autolinking feature so now you have link your assets in native module or else you can use
react-native-asset

remaining steps are same as before crate a file in root directory of project

react-native.config.js

module.exports = {
    project: {
        ios: {},
        android: {}
    },
    assets: ['./src/assets/'],
};

after installing react-native-asset run below command

yarn react-native-asset or npx react-native-asset
贪恋 2025-02-20 00:59:42

图标的手册设置&尝试以下步骤

1.添加此行android/app/build.gradle
申请来自:“ ../../ node_modules/reaeact-native-vector-icons/fonts.gradle”

2. ADD此行Android/setter.gradle
包括“:反应 - 媒介 - 元素”
project(':react-native-vector-icons')。projectDir = new file(rootproject.projectdir,'../ node_modules/reaeact-native-vector-icons/android'):

Manual setup for icons & try these steps

1.add this line android/app/build.gradle
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

2.add this line android/setting.gradle
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android'):

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文