react-native-android-badge icon indicating copy to clipboard operation
react-native-android-badge copied to clipboard

TypeError: undefined is not an object (evaluating '_reactNativeAndroidBadge2.default.setBadge')

Open pajaploy opened this issue 6 years ago • 5 comments

I tried to use react-native-android-badge but It was error

[Unhandled Promise rejection: TypeError: undefined is not an object (evaluating '_reactNativeAndroidBadge2.default.setBadge')]

My code is

  1. import BadgeAndroid from 'react-native-android-badge'
  2. BadgeAndroid.setBadge(10)

version

  • "react": "16.0.0-alpha.12
  • "react-native": "^0.48.0"

pajaploy avatar Dec 20 '17 09:12 pajaploy

Add compile project(':react-native-android-badge') as dependency to your \android\app\build.gradle file

  • you can also execute gradlew clean in your android directory

solonik1 avatar Jan 06 '18 18:01 solonik1

Not working

Annihil avatar Mar 05 '18 20:03 Annihil

as I can see you have not link the package please do react-native link react-native-android-badge

KunalPaul avatar Mar 12 '18 04:03 KunalPaul

and then try to restart the app hope it works

KunalPaul avatar Mar 12 '18 04:03 KunalPaul

@Annihil @pajaploy Seem react-native link react-native-android-badge not work perfectly Please add compile project(':react-native-android-badge') on android/app/build.gradle manually

duytq94 avatar Nov 27 '18 10:11 duytq94