mkuczera / react-native-haptic-feedback

React-Native Haptic Feedback for iOS with Android similar behaviour.
MIT License
879 stars 109 forks source link

RNReactNativeHapticFeedback is not available #91

Closed jalaliyev closed 1 year ago

jalaliyev commented 1 year ago

Hey! I want to use haptic vibration once button tap but I have faced weird issue. When click button I am getting warning and haptic vibration is not working.

"react-native": "0.70.1", "react-native-haptic-feedback": "^1.14.0",

Usage: const onHeptic = () => ReactNativeHapticFeedback.trigger('impactMedium', options);

Is this package has any problem?

mkuczera commented 1 year ago

Not known at least. Did you run pod install after adding the package?

ingvardm commented 1 year ago

Same issue here on both Android and iOS (after pod install) "react-native": "0.70.1" "react-native-haptic-feedback": "2.0.0"

Bardiamist commented 1 year ago

Same problem on the old architecture after update react-native-haptic-feedback to 2.0.0. On iOS simulator.

mkuczera commented 1 year ago

Ok, could reproduce. Will fix the issue and involve an example project to avoid further mistakes

mkuczera commented 1 year ago

Can you maybe check the following Branch? https://github.com/mkuczera/react-native-haptic-feedback/tree/release/2.0.0-fix

I´m currently client related in a hurry. But the Playground is working fine now. Would appreciate to have just a feedback if it´s working now on their setup @Bardiamist @ingvardm @JalalAliyev

mkuczera commented 1 year ago

Version 2.0.1 is release now and should resolve the issue

ingvardm commented 1 year ago

Thanks, @mkuczera, iOS is working, however Android emulator still throws this warning (RNReactNativeHapticFeedback is not available). Trying to manually link this package yields this error during build:

> Error while evaluating property 'namespace' of task ':react-native-haptic-feedback:generateDebugBuildConfig'
   > Failed to calculate the value of task ':react-native-haptic-feedback:generateDebugBuildConfig' property 'namespace'.
      > Failed to calculate the value of property 'namespace'.
         > Manifest file does not exist: [project path]/node_modules/react-native-haptic-feedback/android/src/main/AndroidManifest.xml

node_modules/react-native-haptic-feedback/android/src directory is not present

EDIT: Cloning and building works for android. Probably some packaging issue. .npmignore

Playground
src
.vscode

here the "src" also ignores "android/src"

Romick2005 commented 1 year ago

Got this build error on iOS: error Failed to build the app: No package name found. We couldn't parse the namespace from neither your build.gradle[.kts] file at */node_modules/react-native-haptic-feedback/android/build.gradle nor your package in the AndroidManifest at null.

mkuczera commented 1 year ago

Thanks for the fast reply. Adjusted the npmignore and checked the included files. Everything is present now in the 2.0.2. Will unpublish the other ones. Sorry for the situation. @Romick2005 @ingvardm

ingvardm commented 1 year ago

@mkuczera Everything works now. Thanks and have a productive day!

ethanstacey commented 1 year ago

I got this issue when I forgot to cd ios; pod install

ice-cap0 commented 1 year ago

still getting this

ayoubechc commented 1 year ago

still getting RNReactNativeHapticFeedback is not available when using 2.0.2, 2.0.1, 2.0.3 @mkuczera

jordanpy14 commented 1 year ago

@ayoubechc where you able to fix it ?

ayoubechc commented 1 year ago

@ayoubechc where you able to fix it ?

I use version 1.13.0 with react native version :0.66.0, and it work fine

EliottPal commented 1 year ago

Same issue here, using the latest version.

"react-native-haptic-feedback": "^2.0.3",

arlovip commented 1 year ago

The same issue on 2.0.3(Latest version).

arlovip commented 1 year ago

@mkuczera I noticed that the issue you said has been fixed in 2.1.0 on conversion: pull/108. So when will it be published on 2.1.0? I really appreciate it if you can publish it soon.

farooqalam20996 commented 1 year ago

me too, is ther any solution

Iuriy-Budnikov commented 1 year ago

I'm still getting an error RNReactNativeHapticFeedback is not available 2.2.0

juliendevleeschauwer commented 1 year ago

I'm still getting an error RNReactNativeHapticFeedback is not available 2.2.0

are you rebuild completely the app after install the package ? I rebuild with xcode and the error disapear ;)

SathishSaminathan commented 9 months ago

After Rebuilding the app in XCode and the error resolved

mikhaildegtuarev commented 2 months ago

In the "react-native-haptic-feedback" version: "^2.3.1", this problem is present