remobile / react-native-toast

A android like toast for android and ios, android use native toast, ios use UIView+Toast
MIT License
346 stars 146 forks source link

android error undefined is not an object(evaluating 'RECTToast.show') #17

Open jony-w opened 7 years ago

jony-w commented 7 years ago

package.json

"dependencies": { "@remobile/react-native-toast": "^1.0.5", }

use

import Toast from '@remobile/react-native-toast'; render() { return ( <TouchableOpacity onPress={Toast.showShortTop.bind(null, "this is a message")}>

Hello fffworld!
                </TouchableOpacity>
     )

}

error: undefined is not an object(evaluating 'RECTToast.show') cannot read property 'show' of undefined May I ask what is the reason?

maotora commented 7 years ago

@jonyshi I have the same issue too.. :(

otech47 commented 7 years ago

Make sure to follow the README for the Android setup. I got this error then added

import com.remobile.toast.RCTToastPackage;

and

new RCTToastPackage()

to MainApplication.java and it worked