inway / flutter_ringtone_player

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

Implicit integer conversion warning #6

Closed zachdtaylor closed 1 year ago

zachdtaylor commented 4 years ago

I'm using flutter_ringtone_player in my app, and when build it for iOS, I get the following warning

    /Users/zacharytaylor/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_ringtone_player-2.0.0/ios/Classes/FlutterRingtonePlayerPlugin.m:17:38: warning: implicit
    conversion loses integer precision: 'NSInteger' (aka 'long') to 'SystemSoundID' (aka 'unsigned int') [-Wshorten-64-to-32]
            AudioServicesPlaySystemSound([soundId integerValue]);
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~
    1 warning generated.
emadal95 commented 4 years ago

Same. I cannot build for ios at all

emadal95 commented 4 years ago

After trying literally every possible thing, I made it work. What I did was this:

  1. I temporarily removed the FlutterRingtonPlayer dependency from my pubspec.yaml file.
  2. I cleaned the project build folder from XCode.
  3. I went back to VS Code and ran 'flutter clean'.
  4. I moved into the ios folder of my flutter project and ran the following commands (in the following order):
    • pod deintegrate
    • flutter pub get
    • pod install
  5. I then ran the application from VS Code on one of the iOS simulator (note, the FlutterRingtonePlayer is not included yet).
  6. While the application was running correctly, I modified the pubspec.yaml file again to re-include the FlutterRingtonePlayer dependency and hit save to force the pub get command to run again;
  7. I then stopped the application and proceeded to run it again and the error was gone and everything compiled and ran correctly.

Honestly not sure what was going on. I started experiencing the issue after upgrading flutter to a new version but this fixed the problem for me!

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.