React-native-sound import crashes the App

296 Views Asked by At

I'm not new to React, but I'm new to React Native. I've jumped very optimistic to it, but for now it looks like one big fat buggy thing. I wanted to build just simple metronome, but spent hours dealing with bugs. And here's one more. react-native-sound package just doesn't want to work. I follow documentation and just right after var Sound = require('react-native-sound'); app crashes with

./node_modules/react-native/Libraries/Image/AssetSourceResolver.js:25:17
Module not found: Can't resolve '../Utilities/Platform'
  23 | const PixelRatio = require('../Utilities/PixelRatio');
  24 | const {pickScale} = require('./AssetUtils');
> 25 | const Platform = require('../Utilities/Platform');
     |                 ^
  26 |
  27 | const invariant = require('invariant');
  28 |

I just can't find the answer why it happens. Any ideas? My app was created with Expo.

P.S.: Everything I've worked with in web developement, even if we're speaking about some small not very popular packages seems like heaven with super clear documentation, q&a's around the internet etc. compare to React native stuff. So if idea of using RN was the bad idea, just let me know)

0

There are 0 best solutions below