mkuczera / react-native-haptic-feedback

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

RNReactNativeHapticFeedback is not available #50

Closed V0lantis closed 4 years ago

V0lantis commented 4 years ago

I checked the similar issues, but wasn't been able to resolved it mine. Had a RNReactNativeHapticFeedback is not available warning, and no feedback when I clicked on the button. Running on the latest iOS version (13.4), Expo version 2.15.2, and react-native 0.62. IMG_5075

here is my log in my console.

RNReactNativeHapticFeedback is not available
- node_modules/expo/build/environment/muteWarnings.fx.js:18:23 in warn
- node_modules/react-native-haptic-feedback/index.js:14:22 in RNReactNativeHapticFeedback.trigger
* components/Twitter/TwitterHeart.js:13:24 in onPress
- node_modules/react-native/Libraries/Components/Touchable/TouchableHighlight.js:336:45 in createReactClass$argument_0.touchableHandlePress
* [native code]:null in touchableHandlePress
- node_modules/react-native/Libraries/Components/Touchable/Touchable.js:880:34 in TouchableMixin._performSideEffectsForTransition
* [native code]:null in _performSideEffectsForTransition
- node_modules/react-native/Libraries/Components/Touchable/Touchable.js:779:44 in TouchableMixin._receiveSignal
* [native code]:null in _receiveSignal
- node_modules/react-native/Libraries/Components/Touchable/Touchable.js:490:24 in TouchableMixin.touchableHandleResponderRelease
* [native code]:null in touchableHandleResponderRelease
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:307:15 in invokeGuardedCallbackImpl
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:531:36 in invokeGuardedCallback
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:555:30 in invokeGuardedCallbackAndCatchFirstError
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:722:42 in executeDispatch
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:744:20 in executeDispatchesInOrder
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:907:29 in executeDispatchesAndRelease
* [native code]:null in forEach
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:887:16 in forEachAccumulated
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:932:21 in runEventsInBatch
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:1096:19 in runExtractedPluginEventsInBatch
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:2796:6 in batchedUpdates$argument_0
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18791:14 in batchedUpdates$1
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:2709:30 in batchedUpdates
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:2794:17 in batchedUpdates$argument_0
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:2870:28 in receiveTouches
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:436:47 in __callFunction
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:111:26 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:384:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/Messa

Not have any clue in what to do. Thx very much for your potential help :)

ghost commented 4 years ago

Hi @V0lantis , did you find a solution ?

radiosilence commented 4 years ago

Did you do pod install?

I found error by going to ./node_modules/react-native-haptic-feedback/index.js and changing so that the console.warn outputs err

V0lantis commented 4 years ago

Hi @V0lantis , did you find a solution ?

I think it is because I'm using expo cli and no react-native cli. This link explain a little bit why. I should try with a bare rect-native application and not an expo application

V0lantis commented 4 years ago

Did you do pod install?

I found error by going to ./node_modules/react-native-haptic-feedback/index.js and changing so that the console.warn outputs err

No because I'm using expo, but I'll try. Thanks for the reply

ghost commented 4 years ago

@radiosilence @V0lantis I did pod install without linking I thought it was auto linking 😅. Thanks

darnfish commented 4 years ago

If you're using Expo / Managed Workflow then have a look at this: https://docs.expo.io/versions/latest/sdk/haptics/

nelsonprsousa commented 4 years ago

A little bit offtopic, but what is necessary to allow autolinking in this library? 😎

pxl-live commented 4 years ago

A little bit offtopic, but what is necessary to allow autolinking in this library? 😎

bang on topic!!

Ray285 commented 4 years ago

Running $ react-native link react-native-haptic-feedback && cd ios && pod install resolved the issue for me. The auto-linking doesn't seem to be fully working currently.