flutter-plugins icon indicating copy to clipboard operation
flutter-plugins copied to clipboard

[noise_meter: 3.0.2] Doesn't work for iOS.

Open romakononovich opened this issue 3 years ago • 8 comments

Device / Simulator

  • Device: iPhone XS / Any device in the simulator
  • OS: 14.6

Describe the bug

Even an example does not work: https://github.com/cph-cachet/flutter-plugins/tree/master/packages/noise_meter/example. Nothing happens after pressing the "microphone" button. Doesn't even ask permission to the microphone. There are no errors in the logs.

To Reproduce

Download the example and try to run it :) https://github.com/cph-cachet/flutter-plugins/tree/master/packages/noise_meter/example

Expected behavior

Working example :) Request for microphone access and get data.

Actual behavior

Empty :(

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.2.2, on macOS 11.5.2 20G95 darwin-arm, locale ru-BY) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 4.1) [✓] Android Studio (version 2020.3) [✓] Android Studio (version 4.0) [✓] Android Studio (version 4.1) [✓] Connected device (3 available)

• No issues found!

Additional information

Works on Android.

romakononovich avatar Aug 29 '21 21:08 romakononovich

WIth me there is the same error occurs with version 3.0.0, 3.0.1.

hiep2x avatar Sep 16 '21 15:09 hiep2x

Device / Simulator

  • Device: iPhone XS / Any device in the simulator
  • OS: 14.6

Describe the bug

Even an example does not work: https://github.com/cph-cachet/flutter-plugins/tree/master/packages/noise_meter/example. Nothing happens after pressing the "microphone" button. Doesn't even ask permission to the microphone. There are no errors in the logs.

To Reproduce

Download the example and try to run it :) https://github.com/cph-cachet/flutter-plugins/tree/master/packages/noise_meter/example

Expected behavior

Working example :) Request for microphone access and get data.

Actual behavior

Empty :(

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.2.2, on macOS 11.5.2 20G95 darwin-arm, locale ru-BY) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 4.1) [✓] Android Studio (version 2020.3) [✓] Android Studio (version 4.0) [✓] Android Studio (version 4.1) [✓] Connected device (3 available)

• No issues found!

Additional information

Works on Android.

Did you try with 3.0.0, 3.0.1 versions? There is the same issue, right?

hiep2x avatar Sep 17 '21 10:09 hiep2x

Change your error handler to any of the following, then it will work properly

  void onError(Object o, StackTrace e) {
    print(e.toString());
  }

or

  void onError(Object o) {
    print(e.toString());
  }

yeliulee avatar Sep 23 '21 23:09 yeliulee

Change your error handler to any of the following, then it will work properly

  void onError(Object o, StackTrace e) {
    print(e.toString());
  }

or

  void onError(Object o) {
    print(e.toString());
  }

You mean the onError function in the declaration of NoiseMeter? I just tried as you mentioned:

@override
  void initState() {
    super.initState();
    _noiseMeter = new NoiseMeter(onError);
  }

  void onError(Object o, StackTrace e) {
    print(e.toString());
  }

but the issue still persist.

hiep2x avatar Sep 24 '21 03:09 hiep2x

Change your error handler to any of the following, then it will work properly

  void onError(Object o, StackTrace e) {
    print(e.toString());
  }

or

  void onError(Object o) {
    print(e.toString());
  }

You mean the onError function in the declaration of NoiseMeter? I just tried as you mentioned:

@override
  void initState() {
    super.initState();
    _noiseMeter = new NoiseMeter(onError);
  }

  void onError(Object o, StackTrace e) {
    print(e.toString());
  }

but the issue still persist.

FDF8BEED-1CE5-4A18-A8BE-936A4392236D

But mine does work fine. I'm using noise_meter: ^3.0.2

yeliulee avatar Oct 08 '21 14:10 yeliulee

Any update on this, still doesnt work.

@yeliulee @hiep2x Are you using it with camera recording?

devibrahimkarahan avatar Oct 23 '21 08:10 devibrahimkarahan

I solved it with change permission_handler package version from 8.0.0 to 7.2.0. I dont know why, but its worked

noise_meter: ^3.0.1 permission_handler: ^7.2.0

devibrahimkarahan avatar Oct 23 '21 10:10 devibrahimkarahan

Got the same problem and found solution:

In permission_handler library after version 8.0.0 you must list permission you want to use inside post_install method inPodfile. Without this action it will always return denied status, so microphone will not be enabled.

For more info and steps required to fix it you can check setup section in permission_handler.

Nimolee avatar Dec 22 '21 15:12 Nimolee