Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React-native link is not working properly

I tried installing and linking react-native sound into my project. However, when I run the following command in my project directory,

react-native link react-native-sound

the library doesn't link and I get the following result:

Scanning 758 folders for symlinks in /Users/MY_USER_NAME/PROJECT_NAME/node_modules 

I think my node or npm setup is wrong.

like image 422
Drew Gallagher Avatar asked Jun 26 '17 01:06

Drew Gallagher


People also ask

Is react-native link deprecated?

The post `react-native link` without package name is Deprecated is regarding the deprecation of react-native link without the package name. If you are using a library with some native functionality then you need to make some changes in the Android and IOS files and that is called linking.

What is Linking react-native?

react-native link is an automatic way for installing native dependencies. It is an alternative to manually linking the dependency in your project. It works for both Android and iOS.


2 Answers

1- create new file in project root and name it react-native.config.js

2- add this code to react-native.config.js :

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

3- change ['./src/assets/fonts/'] to your fonts path

4- now run react-native link

thats it

like image 86
Mohammad Akbari Avatar answered Oct 16 '22 08:10

Mohammad Akbari


Ok after some digging, I found the issue. https://github.com/facebook/react-native/pull/14863

Maybe try applying that fix locally, it should work then.

like image 33
HazA Avatar answered Oct 16 '22 07:10

HazA