skip to Main Content

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?

3

Answers


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

    So, please try this:

    npx react-native-asset
    
    Login or Signup to reply.
  2. 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
    
    Login or Signup to reply.
  3. 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’):

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search