react-native-sound: Troubleshooting "undefined is not an object (evaluating 'RNSound.IsAndroid')"

The most common problem developers experience with this library is undefined is not an object (evaluating 'RNSound.IsAndroid').

This is caused by the library’s native code not being linked. This is a tooling issue and seems to have a variety of different specific resolutions, depending on your environment.

See these related threads:

  • #36 (48 comments)
  • #215 (30 comments)
  • #128 (16 comments)
  • #471 (14 comments)

If you’re experiencing this issue and want help troubleshooting it, please review those threads first. If you aren’t able to resolve the problem, please open a new issue with a link to a project that reproduces the project, information about your environment, and information about the steps you have tried.

Meanwhile, it would be very helpful if someone could collect the troubleshooting advice from those sources, and write it up in the readme.

Note, also reported here:

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 18 (1 by maintainers)

Most upvoted comments

react-native link react-native-sound cd ios pod install

fixed my problem

https://stackoverflow.com/questions/57698661/undefined-is-not-an-object-evaluating-rnsound-isandroid

If I get it right, I can never get this to work when my App is made with Expo? I am new to React-native and just did buy a course to learn and wanted to try to implement react-native-sound and keep getting this error. My package.json looks like this: { "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web", "eject": "expo eject" }, "dependencies": { "expo": "^33.0.0", "pod": "^0.9.0", "react": "16.8.3", "react-dom": "^16.8.6", "react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz", "react-native-sound": "^0.11.0", "react-native-web": "^0.11.4", "react-navigation": "^3.11.0" }, "devDependencies": { "babel-preset-expo": "^5.1.1" }, "private": true }

Edit: I guess I have to use this then? https://docs.expo.io/versions/latest/sdk/audio/

Edit 2: That seems to be it. You can’t use native modules with Expo unless you want to work around it: https://docs.expo.io/versions/latest/expokit/eject/

*I will just leave this here in case it helps other people. I am probably not the only beginner trying to do this. Feel free to delete it if this does not belong here 😃

None of these fixed the issue in IOS at RN 0.60.4, also manual linking is not working at all… So what to do?