undefined is not an object(evaluating RNSound.IsAndroid)


#1

i am building a simple app which plays audio files (.mp3). did install react-native-sound
linked it it is in my node modules.
getting this error on deploying app on expo mobile app:
— undefined is not an object(evaluating RNSound.IsAndroid)—
i did lot of research n found answers like editing mainapplication.java file, system.gradle etc but none helps with expo projects.
plz help me with this.


#2

Hey @krishna1012,

In order to use react-native-sound, you would have to detach your Expo project which gives you the ios and android files necessary to do the native configurations required. https://docs.expo.io/versions/v27.0.0/expokit/detach

We do have an Audio API https://docs.expo.io/versions/v27.0.0/sdk/audio in the SDK that may provide what you need.

Cheers,

Adam


#3

@krishna1012 did this work for you?

I’m running into the same problem but after detaching my project I’m still getting "undefined is not an object (evaluating ‘RNSound.IsAndroid’)


#4

Hi @rlozon11 - did you follow the normal steps to install react-native-sound after detaching? This usually includes something like running react-native link, which it looks like you may be missing.

Additionally, out of curiosity, is there some functionality you need that react-native-sound provides that Expo’s own Audio API does not?


#5

Yeah it worked for me thanks but now I m facing issue that rn sound get duration returns 0 when testing on Android 7 but works fine on Android 6


closed #6

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.