New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All of the listen() method can't be called after called initialize() #185
Comments
if I don't use initialize, everything goes well. |
Is isolate causes this problem? |
Does it happen in the example project? |
@hnvn I need to try |
@hnvn I tried and the result is when I stop using the initialize method, my listen method will be called many times. But if I use the initialize method, then it causes some problems
|
@hnvn based on your example. I only adjust initState() and initialize() to make the code running. |
flutter_sound: ^1.4.8 |
this happened to me too,still struggling |
It is much helpful if you can give me a repository to reproduce this issue |
@hnvn here: https://github.com/lxcyha/flutter_downloader_problem, you can uncomment initialize and see what diffs between comment and uncomment |
@hnvn click the RaisedButton and speak some words you can see onRecorderDbPeakChanged can be triggered multiple times. And when you uncomment initialize. it will only trigger 1 time. |
I will have a look at it this weekend. My time within the week is quite tight |
@hnvn thanks, in advanced |
Just have a quick look at your codes and see you are missing permission configuration as described in |
@hnvn you mean android? I already added permission to info.plist. and you can see the different behavior of tapping the button. |
@hnvn you can see it in info.plist:
and for the property NSMicrophoneUsageDescription, that doesn't matter. It's just a description. |
I tried but |
@hnvn you haven't seen this log? Once you click the RaisedButton, it will show some logs, and when you uncomment initialize method, you can't see these logs until 10 seconds later. Did you try it in ios simulator? |
Use this plugin cause the channel invokeMethod not work |
Considering this stale and closing. Feel free to open a new issue if the problem reoccurs. |
version: flutter_downloader: ^1.3.3
platform: ios simulator
code below:
void main() async{ await FlutterDownloader.initialize(); runApp(MusicianApp()); }
plugin audioplayers:^0.12.0:
audioPlayer.onPlayerStateChanged.listen((state) { // never being called }
plugin flutter_sound: ^1.4.8:
flutterSound.onRecorderDbPeakChanged.listen((value) { // never being called })
flutter doctor -v :
[✓] Flutter (Channel stable, v1.9.1+hotfix.4, on Mac OS X 10.14.6 18G1012, locale en-CN)
• Flutter version 1.9.1+hotfix.4 at /Users/cyh/flutter
• Framework revision cc949a8e8b (9 weeks ago), 2019-09-27 15:04:59 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/cyh/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.2.1, Build version 11B500
• CocoaPods version 1.7.0.beta.3
[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 34.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.3.4)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 32.0.3
• Dart plugin version 183.5429.25
[✓] VS Code (version 1.36.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.1.0
[✓] Connected device (1 available)
• iPhone X • DFDBB98C-3C75-4688-8832-83AE4FD2001D • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-4 (simulator)
! Doctor found issues in 1 category.
The text was updated successfully, but these errors were encountered: