benjamindean / flutter_vibration

Handle vibration on iOS and Android in Flutter apps
219 stars 68 forks source link

Depricated warning #14

Closed ceciliamzayek closed 4 years ago

ceciliamzayek commented 4 years ago

I am getting this warning when I run flutter:

Note: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/vibration-1.2.1/android/src/main/java/com/benjaminabel/vibration/VibrationPlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

benjamindean commented 4 years ago

Most likely it's about the vibrate method. The old method is marked as deprecated, but as far as I know, still works on the old Android versions.

ceciliamzayek commented 4 years ago

oh so I can just leave it as it is?

benjamindean commented 4 years ago

Yes, it's just a warning which you can ignore. I'll try to get rid of it, if possible.

hrashdan commented 4 years ago

google play rejected my app update !

image

I add android.debug.obsoleteApi=true to "gradle.properties" to debug the api and ....

image

so I opened the developer reference and I got this msg:

image

you can update your flutter_vibration plugin to VibrationEffect from here

https://developer.android.com/reference/android/os/VibrationEffect

jdeltoft commented 4 years ago

I get this error, and when I build apks (debug or release) and side install them, it fails to vibrate on two different android phones I've tested so far.

UPDATE: sorry! I was wrong. I was using HapticFeedback.vibrate(); Using this plugin worked perfectly now for me from the apk.

saddy001 commented 4 years ago

I'm also getting the deprecation warning.

benjamindean commented 4 years ago

This warning shouldn't affect anything because there is a check for API revision to support old Android versions. The only thing I can do is add @SuppressWarnings to the method call. But I can only do it next week. Sorry for the inconvenience. The plugin should still work as expected.

malikdoksoz commented 4 years ago

This warning shouldn't affect anything because there is a check for API revision to support old Android versions. The only thing I can do is add @SuppressWarnings to the method call. But I can only do it next week. Sorry for the inconvenience. The plugin should still work as expected.

Cool