flutter-plugins
flutter-plugins copied to clipboard
[noise_meter: 3.0.2] Doesn't work for iOS.
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.
WIth me there is the same error occurs with version 3.0.0, 3.0.1.
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?
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());
}
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.
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.
But mine does work fine. I'm using noise_meter: ^3.0.2
Any update on this, still doesnt work.
@yeliulee @hiep2x Are you using it with camera recording?
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
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.