title: "undefined is not a function" when create android native module in ReactNative
body: <p>I'm following <a href="https://facebook.github.io/react-native/docs/native-modules-android.html" rel="noreferrer">ReactNative Native Module Guide</a> to write the java class that can be used in JS side. The exported method is <code>show</code> from class <code>ToastModule</code>(exported as <code>ToastAndroid</code>). The <code>show</code> method is below:</p>
  
  <pre><code>public void show(String message, int duration) {
      Toast.makeText(getReactApplicationContext(), message, duration).show();
  }
  </code></pre>
  
  <p>All work as expected with the toast button appear when I invoke ToastAndroid.show from Button onPress handler. </p>
  
  <pre><code>import React, { Component } from 'react';
  import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Button,
    NativeModules,
  } from 'react-native';
  
  const ToastAndroid = NativeModules.ToastAndroid
  
  export default class App extends Component {
  
  handleBTNPressed(){
    ToastAndroid.show('Awesome', ToastAndroid.SHORT);
  }
  render() {
    return (
      &lt;View style={styles.container}&gt;
        &lt;Text style={styles.welcome}&gt;
          Welcome to React Native!!
        &lt;/Text&gt;
        &lt;Button title='click me' onPress={()=&gt;this.handleBTNPressed()}/&gt;
      &lt;/View&gt;
    );
   }
  }
  </code></pre>
  
  <p>However, when I further change the function name from</p>
  
  <pre><code>@ReactMethod
  public void show(String message, int duration) {
      Toast.makeText(getReactApplicationContext(), message, duration).show();
  }
  </code></pre>
  
  <p>to </p>
  
  <pre><code>@ReactMethod
  public void showAgain(String message, int duration) {
      Toast.makeText(getReactApplicationContext(), message, duration).show();
  }
  </code></pre>
  
  <p>I encounter the following error:"undefined is not a function"</p>
  
  <p><a href="https://i.stack.imgur.com/L4abSl.png" rel="noreferrer"><img src="https://i.stack.imgur.com/L4abSl.png" alt="enter image description here"></a></p>
  
  <p>this error shows again if I add a new exported method as following:</p>
  
  <pre><code>@ReactMethod
  public void showAgain2(String message, int duration) {
      String mes = "Hi " + message;
      Toast.makeText(getReactApplicationContext(), message, duration).show();
  }
  </code></pre>
  
  <p>Is there anyone know which step I goes incorrectly? </p>
  
  <p>EDIT==========================</p>
  
  <p>There might already be a <code>ToastAndroid</code> in ReactNative, so I change the name to <code>MyToastExample</code>. However, now the error become the following</p>
  
  <p><a href="https://i.stack.imgur.com/NOdJll.png" rel="noreferrer"><img src="https://i.stack.imgur.com/NOdJll.png" alt="enter image description here"></a></p>
  
  <p>Does anyone encounter the same issue?</p>