inway / flutter_ringtone_player

Simple Flutter plugin to play ringtone, alarm & notification sounds
MIT License
92 stars 57 forks source link

Deprecate warning #14

Closed andzejsw closed 1 year ago

andzejsw commented 3 years ago

Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_ringtone_player-2.0.0\android\src\main\java\io\inway\ringtone\player\FlutterRingtonePlayerPlugin.java uses or overrides a deprecated API. Everything works fine, but there is warning visible. Need to fix this, before it causes some more trouble.

madatr commented 3 years ago

+1 this

SPodjasek commented 3 years ago

Any details about API this note references to?

madatr commented 3 years ago

Hi, sorry for the delay in the reply.

Recompiling with: -Xlint:deprecation By adding it to build.gradle here:

allprojects { gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:deprecation" } } }

The output is:

/.......//flutter/.pub-cache/hosted/pub.dartlang.org/flutter_ringtone_player-2.0.0/android/src/main/java/io/inway/ringtone/player/FlutterRingtonePlayerPlugin.java:100: warning: [deprecation] setStreamType(int) in Ringtone has been deprecated ringtone.setStreamType(AudioManager.STREAM_ALARM); ^ 1 warning

This is in the java plugin file, i'm not too proficient in java but what i've found is that: setStreamType was deprecated in API Level 21+ and according to this, the use of streams is deprecated.

serkanayaz commented 3 years ago

+1 this

madatr commented 3 years ago

You should prioritise this as I was testing on an android phone with OS 6.1.0 and it was working fine but testing on Android OS 7.0.0 it does not work, I suppose the function was removed in that version which means that the package does not work any more.

SPodjasek commented 3 years ago

@madatr @andzejsw After merging #21 is it still a thing?

andzejsw commented 3 years ago

@madatr @andzejsw After merging #21 is it still a thing?

Yes. Haven't worked on deprecation warning issue.

andzejsw commented 3 years ago

@madatr @andzejsw After merging #21 is it still a thing?

Adding "android.useDeprecatedNdk=true" to "gradle.properties" removes warning. So problem should be there.

github-actions[bot] commented 1 year ago

This issue has stalled.

github-actions[bot] commented 1 year ago

This issue has been closed due to inactivity.