^1.4.8
Doctor summary (to see all details, run flutter doctor -v):
[β] Flutter (Channel stable, v1.9.1+hotfix.4, on Microsoft Windows [Version 10.0.18362.387], locale de-DE)
[β] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[β] Android Studio (version 3.5)
[β] Connected device (1 available)
β’ No issues found!
Android, as I have no IOS to test
Recording starts as usual.
calling _flutterSound.startRecorder with sepcific path resulst in Exception. Calling with null as uri works.
E/FlutterSoundPlugin(24685): Exception:
E/FlutterSoundPlugin(24685): java.io.FileNotFoundException: /storage/emulated/0/data/user/0/dt.de.voicematching/app_flutter/IfJMfNhpB7NsQmcmbtMc: open failed: ENOENT (No such file or directory)
E/FlutterSoundPlugin(24685): at libcore.io.IoBridge.open(IoBridge.java:496)
E/FlutterSoundPlugin(24685): at java.io.RandomAccessFile.
E/FlutterSoundPlugin(24685): at java.io.RandomAccessFile.
E/FlutterSoundPlugin(24685): at android.media.MediaRecorder.prepare(MediaRecorder.java:1046)
E/FlutterSoundPlugin(24685): at com.dooboolab.fluttersound.FlutterSoundPlugin.startRecorder(FlutterSoundPlugin.java:167)
E/FlutterSoundPlugin(24685): at com.dooboolab.fluttersound.FlutterSoundPlugin.lambda$onMethodCall$0$FlutterSoundPlugin(FlutterSoundPlugin.java:70)
E/FlutterSoundPlugin(24685): at com.dooboolab.fluttersound.-$$Lambda$FlutterSoundPlugin$Uw7hmMVnMhHSlTmtp8I_WAUlmZE.run(Unknown Source:8)
E/FlutterSoundPlugin(24685): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
E/FlutterSoundPlugin(24685): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/FlutterSoundPlugin(24685): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/FlutterSoundPlugin(24685): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FlutterSoundPlugin(24685): at java.lang.Thread.run(Thread.java:919)
E/FlutterSoundPlugin(24685): Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
E/FlutterSoundPlugin(24685): at libcore.io.Linux.open(Native Method)
E/FlutterSoundPlugin(24685): at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
E/FlutterSoundPlugin(24685): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
E/FlutterSoundPlugin(24685): at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
E/FlutterSoundPlugin(24685): at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7255)
E/FlutterSoundPlugin(24685): at libcore.io.IoBridge.open(IoBridge.java:482)
E/FlutterSoundPlugin(24685): ... 11 more
Real Device: Pixel 2. Android Version 10. Build-Number: QP1A. 190711.020
FlutterSound _flutterSound = FlutterSound();
//some string. example: IfJMfNhpB7NsQmcmbtMc
String widget.audioFileName = "IfJMfNhpB7NsQmcmbtMc"
final String path = await getApplicationDocumentsDirectory();
await _flutterSound.startRecorder('$path/' + widget.audioFileName);
//path for example: /storage/emulated/0/data/user/0/dt.de.voicematching/app_flutter/IfJMfNhpB7NsQmcmbtMc
When forcing downgrade in pubspec.yaml to 1.4.7 the mentioned code works.
Could you compare your code with example project? You need to give specific extensions based on the platform.
Can you describe more detailled what for informations you need?
The code in Steps to reproduce should be enough to reproduce this issue with a clean app.
Check this line in example project.
Oh okay. You mean specific file types based on platform. This is new in 1.4.8? Because currently I do not set any.
Yeah. I should have to update the doc. Maybe you could give a try PRing. Also note that you should specify extension based on the platform.
Yeah. I should have to update the doc. Maybe you could give a try
PRing. Also note that you should specifyextensionbased on the platform.
before 1.4.8 #Resolve #129
following is my code , and Can run well
final Directory extDir = await getApplicationDocumentsDirectory();
final String dirPath = '${extDir.path}/Sound/flutter_sound';
fileName = timestamp();
await Directory(dirPath).create(recursive: true);
final String filePath = '$dirPath/$fileName.mp3';
print("filePath~~~~~~~~~~~~~"+filePath);
audioPath = await flutterSound.startRecorder(filePath);
but after 1.4.8 #Resolve #129 , I get a Error
I/flutter (13114): filePath~~~~~~~~~~~~~/data/user/0/com.liangzi.shanxin/app_flutter/Sound/flutter_sound/1570433586622.mp3
E/FlutterSoundPlugin(13114): Exception:
E/FlutterSoundPlugin(13114): java.io.FileNotFoundException: /storage/emulated/0/data/user/0/com.liangzi.shanxin/app_flutter/Sound/flutter_sound/1570433586622.mp3: open failed: ENOENT (No such file or directory)
E/FlutterSoundPlugin(13114): at libcore.io.IoBridge.open(IoBridge.java:455)
E/FlutterSoundPlugin(13114): at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247)
E/FlutterSoundPlugin(13114): at java.io.RandomAccessFile.<init>(RandomAccessFile.java:128)
E/FlutterSoundPlugin(13114): at android.media.MediaRecorder.prepare(MediaRecorder.java:862)
E/FlutterSoundPlugin(13114): at com.dooboolab.fluttersound.FlutterSoundPlugin.startRecorder(FlutterSoundPlugin.java:167)
E/FlutterSoundPlugin(13114): at com.dooboolab.fluttersound.FlutterSoundPlugin.lambda$onMethodCall$0(FlutterSoundPlugin.java:70)
E/FlutterSoundPlugin(13114): at com.dooboolab.fluttersound.-$$Lambda$FlutterSoundPlugin$Uw7hmMVnMhHSlTmtp8I_WAUlmZE.run(lambda)
E/FlutterSoundPlugin(13114): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
E/FlutterSoundPlugin(13114): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E/FlutterSoundPlugin(13114): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
E/FlutterSoundPlugin(13114): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
E/FlutterSoundPlugin(13114): at java.lang.Thread.run(Thread.java:761)
E/FlutterSoundPlugin(13114): Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
E/FlutterSoundPlugin(13114): at libcore.io.Posix.open(Native Method)
E/FlutterSoundPlugin(13114): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:187)
E/FlutterSoundPlugin(13114): at libcore.io.IoBridge.open(IoBridge.java:441)
E/FlutterSoundPlugin(13114): ... 11 more
I/flutter (13114): {message: {"resp":"pong","code":0,"msg":"ζε","data":"1570433588"}, event: onMessage}
I/flutter (13114): {message: {"resp":"pong","code":0,"msg":"ζε","data":"1570433593"}, event: onMessage}
I/flutter (13114): {message: {"resp":"pong","code":0,"msg":"ζε","data":"1570433598"}, event: onMessage}
I/flutter (13114): {message: {"resp":"pong","code":0,"msg":"ζε","data":"1570433603"}, event: onMessage}
I/flutter (13114): {message: {"resp":"pong","code":0,"msg":"ζε","data":"1570433608"}, event: onMessage}
I can fix it by using the default pathοΌ but I want save audio file in project path.
String path = await flutterSound.startRecorder(Platform.isIOS ? 'ios.m4a' : 'android.mp4');
I faced this issue. This only happens for the 1.4.8 version. 1.4.2 version is fine and hence I'm using it at the moment.
version 1.4.7 , Can run well .
This issus wasted my whold day >_<γ
String path = await flutterSound.startRecorder(Platform.isIOS ? 'ios.m4a' : 'android.mp4');
Have you guys tried this in example project? I am not having problem with it.
Hello @hyochan
I do understand the "fix", but what would be the content of the pr? Should I write an update on the documentation or what do you mean exactly?
@Marco-Bronner PR could be anything if you feel it is needed to other people. I can think of doc support currently. Since I do feel this is resolved, I'll close it.
I guess I found the bug:
path = Environment.getExternalStorageDirectory().getPath() + "/" + path;
Since the path is concatenated with another path providing a path will never work.
Also the example is buggy:
String path = await flutterSound.startRecorder(Platform.isIOS ? 'ios.m4a' : 'android.mp4');
This example works, because it does not pass a path but only a filename. But this is an absolutely useless usecase.
I guess I found the bug:
path = Environment.getExternalStorageDirectory().getPath() + "/" + path;Since the path is concatenated with another path providing a path will never work.
Also the example is buggy:
String path = await flutterSound.startRecorder(Platform.isIOS ? 'ios.m4a' : 'android.mp4');This example works, because it does not pass a path but only a filename. But this is an absolutely useless usecase.
THX , i solve the problem by change author's primary code, it works well now
if (path == null) {
path = AudioModel.DEFAULT_FILE_LOCATION;
}
// else {
// path = Environment.getExternalStorageDirectory().getPath() + "/" + path;
// }
I'm not sure why the plugin would prepend Environment.getExternalStorageDirectory().getPath() to the provided path, this caught me out today. Could it just...not do that instead?
Still having this problem has anyone found a good work around to solve the issue.
Most helpful comment
I'm not sure why the plugin would prepend
Environment.getExternalStorageDirectory().getPath()to the provided path, this caught me out today. Could it just...not do that instead?