Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Error: "Haptics" plugin is not implemented on android #4447

Closed
Rosadojonathan opened this issue Apr 7, 2021 · 6 comments
Closed

bug: Error: "Haptics" plugin is not implemented on android #4447

Rosadojonathan opened this issue Apr 7, 2021 · 6 comments
Labels
needs reproduction needs reproducible example to illustrate the issue platform: android

Comments

@Rosadojonathan
Copy link

Rosadojonathan commented Apr 7, 2021

Bug Report

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 2.4.7
  @capacitor/core: 2.4.7
  @capacitor/android: 2.4.7
  @capacitor/ios: 2.4.7

Installed Dependencies:

  @capacitor/cli: 3.0.0-rc.0
  @capacitor/android: 3.0.0-rc.0
  @capacitor/core: 3.0.0-rc.0
  @capacitor/ios: 3.0.0-rc.0

Platform(s)

Android

Current Behavior

I get an "Error: "Haptics" plugin is not implemented on android " error when I try to use the Haptics plugin after updating capacitor to v3 since it didn't seem to work on v2

Expected Behavior

Haptics should work on android

Code Reproduction

https://github.com/Rosadojonathan/capacitor-haptics-bugreport
run
yarn dev:android
Run it on an Android phone, open chrome remote device debugger, console shows "Error: "Haptics" plugin is not implemented on android " when clicking on "haptic test" button

Other Technical Details

npm --version output:

node --version output: 12.4.0

pod --version output (iOS issues only):

Additional Context

#3406 this issue suggested that by upgrading to capacitor v3 I would have Haptics work on android but it doesn't seem to be the case after upgrading

@jcesarmobile jcesarmobile added the needs reproduction needs reproducible example to illustrate the issue label Apr 8, 2021
@Ionitron
Copy link
Collaborator

Ionitron commented Apr 8, 2021

This issue may need more information before it can be addressed. In particular, it will need a reliable Code Reproduction that demonstrates the issue.

Please see the Contributing Guide for how to create a Code Reproduction.

Thanks!
Ionitron 💙

@Ionitron Ionitron added the needs reply needs reply from the user label Apr 8, 2021
@Rosadojonathan
Copy link
Author

Here's the link to reproduce the bug: https://github.com/Rosadojonathan/capacitor-haptics-bugreport
Run
yarn dev:android

@Ionitron Ionitron removed the needs reply needs reply from the user label Apr 8, 2021
@jcesarmobile
Copy link
Member

Since Capacitor 3 has moved plugins out, you need to register them in order to work by adding the plugin in the init method like add(HapticsPlugin.class);

Or even better, enable the automatic plugin registration by deleting the init method or the whole onCreate

https://github.com/Rosadojonathan/capacitor-haptics-bugreport/blob/main/src-capacitor/android/app/src/main/java/org/capacitor/quasar/app/MainActivity.java#L16-L19

@merganon
Copy link

@jcesarmobile (sorry for pinging)
What about iOS?

My MainActivity.java looks like this:

package com.example.app;

import com.getcapacitor.BridgeActivity;

public class MainActivity extends BridgeActivity {}

Still, only Haptics.vibrate(); is working as described here: #3406

@merganon
Copy link

Every function mentioned in https://capacitorjs.com/docs/apis/haptics works for Android
However on iOS only Haptics.vibrate(); is working

Is this intentional? If yes, we should update the documentation

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 10, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs reproduction needs reproducible example to illustrate the issue platform: android
Projects
None yet
Development

No branches or pull requests

4 participants