question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

starting recording fails (silently) to create file on phone

See original GitHub issue

Steps to Reproduce

  1. Using flutter_sound example app to start recording with path ‘/Android/data/com.myapp/files/Sounds/flutter_test/123123.mp4’
  2. when click start, file is not created
  3. async call to flutterSound.startRecord(path) fails silently

Target Platform: Android Target OS version/browser: 9 Devices: Samsung A10

Logs

12-04 10:57:08.724 30756 30775 I flutter : file created path: Android/data/com.crfhealth.umapp.um_app/files/Sounds/flutter_test/1575449828702.mp4 12-04 10:57:08.724 30756 30756 D InputTransport: Input channel constructed: fd=112 12-04 10:57:08.725 30756 30756 D ViewRootImpl@a5a837a[Toast]: setView = android.widget.FrameLayout{6f5572b V.E… …I. 0,0-0,0} TM=true MM=false 12-04 10:57:08.731 4040 25870 D RestrictionPolicy: userId: 0, isMicrophoneEnabledAsUser : true 12-04 10:57:08.731 4040 25870 D RestrictionPolicy: userId: 0 isAudioRecordAllowed : true 12-04 10:57:08.732 30756 30932 W MediaRecorder: prepare: mPath = /storage/emulated/0//storage/emulated/0/Android/data/com.myapp/files/Sounds/flutter_test/1575449405803.mp4 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: Exception: 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: java.io.FileNotFoundException: /storage/emulated/0/storage/emulated/0/Android/data/com.myapp/files/Sounds/flutter_test/1575449405803.mp4: open failed: ENOENT (No such file or directory) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at libcore.io.IoBridge.open(IoBridge.java:485) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at java.io.RandomAccessFile.<init>(RandomAccessFile.java:288) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at java.io.RandomAccessFile.<init>(RandomAccessFile.java:151) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at android.media.MediaRecorder.prepare(MediaRecorder.java:1294) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at com.dooboolab.fluttersound.FlutterSoundPlugin.startRecorder(FlutterSoundPlugin.java:167) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at com.dooboolab.fluttersound.FlutterSoundPlugin.lambda$onMethodCall$0$FlutterSoundPlugin(FlutterSoundPlugin.java:70) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at com.dooboolab.fluttersound.-$$Lambda$FlutterSoundPlugin$Uw7hmMVnMhHSlTmtp8I_WAUlmZE.run(Unknown Source:8) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:459) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at java.util.concurrent.FutureTask.run(FutureTask.java:266) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at java.lang.Thread.run(Thread.java:764) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at libcore.io.Linux.open(Native Method) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:210) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: at libcore.io.IoBridge.open(IoBridge.java:471) 12-04 10:57:08.739 30756 30932 E FlutterSoundPlugin: … 11 more

flutter analyze : no issues

flutter doctor -v :

PS C:\dev\projects\my-app> flutter doctor -v [√] Flutter (Channel dev, v1.12.15, on Microsoft Windows [Version 10.0.18362.476], locale en-GB) • Flutter version 1.12.15 at c:\dev\env\flutter • Framework revision 459c7fb884 (8 days ago), 2019-11-26 17:04:51 +0000 • Engine revision e136d637a8 • Dart version 2.7.0

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3) • Android SDK at C:\dev\env\Android • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 28.0.3 • ANDROID_HOME = C:\dev\env\Android • Java binary at: C:\dev\tools\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03) • All Android licenses accepted.

[√] Android Studio (version 3.5) • Android Studio at C:\dev\tools\Android\Android Studio • Flutter plugin version 41.1.2 • Dart plugin version 191.8593 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code, 64-bit edition (version 1.40.2) • VS Code at C:\Program Files\Microsoft VS Code • Flutter extension version 3.6.0

[√] Connected device (1 available) • SM A105F • R38M109JEXD • android-arm • Android 9 (API 28)

Note: Same implementation works fine on Samsung A70, which seems weird… Phones do differ on target platform / architecture (a10 == armeabi-v7a, a70 == arm64-v8a)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
biklas7commented, Feb 6, 2020

I’m also having the same problem.

Edit I was able to solve this be with:

 final Directory extDir = await getApplicationDocumentsDirectory();
 final String dirPath = '${extDir.path}/filename.aac';
 audioPath = await flutterSound.startRecorder(dirPath);
0reactions
Larpouxcommented, Apr 8, 2020

Please, feel free to re-open this issue if you think it has not been fixed by recent versions

Read more comments on GitHub >

github_iconTop Results From Across the Web

flutter_sound record file creation fails silently - looks for ...
Using flutter_sound example app to start recording with path '/Android/data/com.myapp/files/Sounds/flutter_test/123123.mp4' ...
Read more >
error while creating file path in my screen recording app
I am trying to make a screen recorder app by following this repo but when I runs the app its crashes with Toast...
Read more >
Android Call Recorder - Troubleshooting
Android Call Recorder common problems and solutions. ... Please click the in-call button to start recording only after the call is answered, don't...
Read more >
Easy Voice Recorder Help | Digipom
On Android 4.4 KitKat, the recording may simply fail sporadically, and on Android 5.0 Lollipop, the recording may silently switch to the device...
Read more >
Getting Started with Recording Status Callbacks - Twilio Support
The call recording was silent, and your project is set to automatically delete silent recordings (If you wish to change this option, please...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found