React-native-notifications: Local notification not working on Android

Created on 21 Aug 2017  路  5Comments  路  Source: wix/react-native-notifications

I integrated react-native-notifications and tried using the NotificationsAndroid.localNotification method. The error I am getting is Cannot read property 'postLocalNotification' of undefined

Seems like the code cant find the native modules when importing NativeModules.WixRNNotifications in index.android.js

I double checked all the steps in the installation process and everything seems to be in place.
Am I the only one having this issue?

Androicore

All 5 comments

Issue was with the cache of gradle - make sure you do a ./gradlew clean from android folder.

@denissb I've integrated following all the steps present in docs. How did you solve it? gradlew Clean doesn't work for me.

@witalobenicio make sure the react-native cache is clean, (try https://gist.github.com/jarretmoses/c2e4786fd342b3444f3bc6beff32098d) and restart the app + packager

If you followed all steps on https://github.com/wix/react-native-notifications/blob/master/docs/installation.md#-android it should work.

Hope it helps

Hey why is this closed ? it having a undefined error in 2020

Same error here. It is impressive how every wix library has some weird errors.

Was this page helpful?
0 / 5 - 0 ratings