React-Native java.lang.AssertionError: Attached DialogModule to host with pending alert but no FragmentManager (not attached to an Activity)
<p>I have been working on this for a while and have tried many things, however, I have not been able to figure out this error, to help I will include my code, it should theoretically work as it is an example from react-native-android-speech <a href="https://github.com/mihirsoni/react-native-android-speech" rel="nofollow">https://github.com/mihirsoni/react-native-android-speech</a> I have overridden most of the methods in attempts, I am not sure if it is because it was written a while ago and is having some compatibility issues with the newer versions of react.</p>

<p>main activity.java
    package com.zero;</p>

<pre><code>import android.os.Bundle;

import com.facebook.react.LifecycleState;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactPackage;
import com.facebook.react.ReactRootView;
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
import com.facebook.react.shell.MainReactPackage;
import com.mihir.react.tts.*;

import java.util.Arrays;
import java.util.List;

public class MainActivity extends ReactActivity implements DefaultHardwareBackBtnHandler {

    @Override
    protected String getMainComponentName() {
        String stuff = this.getComponentName().toString();
        return stuff;
    }

    @Override
    public boolean getUseDeveloperSupport(){
        return BuildConfig.DEBUG;
    }

    @Override
    protected List&lt;ReactPackage&gt; getPackages() {
        return Arrays.&lt;ReactPackage&gt;asList(
                new MainReactPackage());
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ReactRootView mReactRootView = new ReactRootView(this);

        ReactInstanceManager mReactInstanceManager = ReactInstanceManager.builder()
                .setApplication(getApplication())
                .setBundleAssetName("index.android.bundle")
                .setJSMainModuleName("index.android")
                .addPackage(new MainReactPackage())
                .addPackage(new RCTTextToSpeechModule())           // Add any extra modules here
                .setUseDeveloperSupport(BuildConfig.DEBUG)
                .setInitialLifecycleState(LifecycleState.RESUMED)
                .build();

        mReactRootView.startReactApplication(mReactInstanceManager, "zero", null);

        setContentView(mReactRootView);
    }
}
</code></pre>

<p>index.android.js</p>

<pre><code>/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';
var tts = require('react-native-android-speech');

tts.speak({
    text:'Please provide some text to speak.', // Mandatory
    pitch:1.5, // Optional Parameter to set the pitch of Speech,
    forceStop : false , //  Optional Parameter if true , it will stop TTS if it is already in process
    language : 'en' // Optional Paramenter Default is en you can provide any supported lang by TTS
}).then(isSpeaking=&gt;{
    //Success Callback
    console.log(isSpeaking);
}).catch(error=&gt;{
    //Errror Callback
    console.log(error)
});

// class zero extends Component {
//   render() {
//     return (
//       &lt;View style={styles.container}&gt;
//         &lt;Text style={styles.welcome}&gt;
//           Welcome to React Native!
//         &lt;/Text&gt;
//         &lt;Text style={styles.instructions}&gt;
//           To get started, edit index.android.js
//         &lt;/Text&gt;
//         &lt;Text style={styles.instructions}&gt;
//           Shake or press menu button for dev menu
//         &lt;/Text&gt;
//       &lt;/View&gt;
//     );
//   }
// }

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});

AppRegistry.registerComponent('zero', () =&gt; zero);
</code></pre>

<p>Thanks in advance for any help.</p>