Ok, so based on Nirar Ranpar's
comment and the link he provided:
https://github.com/zmxv/react-native-sound/issues/36
This is a step to get it working in android using React Native 0.37
1. Edit the android / settings.gradle file to declare the project directory:
include ':RNSound', ':app'
project(':RNSound').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sound/android')
2. Modify android / app / build.gradle to declare the project dependency:
dependencies {
...
compile project(':RNSound')
}
3. Modify the file android / app / src / main / java /.../ MainApplication.java to register your own module:
NOTE: MainApplication.java is not MainActivity.java
...
import com.zmxv.RNSound.RNSoundPackage;
...
...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNSoundPackage()
);
}
...
4. :
import { default as Sound } from 'react-native-sound';
:
var Sound = require('react-native-sound');
import {Sound} from 'react-native-sound';
. 1 2 , 3 4 .