runtime.SoundRecorder Cannot start recording: open failed: ENOENT (No such file or directory)

Hi

My app was working fine, but something broke ¿may be after relase nb188?

Now, when trying to record a voice message I got this error:

com.google.appinventor.components.runtime.SoundRecorder@424dba80,Start,802,Cannot start recording: \/storage\/emulated\/0\/Android\/data\/appinventor.ai_martin_herraizh.DedoCarApp\/files\/My Documents\/Recordings\/app_inventor_1638040020746.3gp: open failed: ENOENT (No such file or directory)

DefaultFileScope property of Screen1 is set to App
Tested at devices with Android 4.4.4 and 8.0.0

¿Any clue?
Thanks

It works fine with the companion, but it fails when the app is built

Those are my blocks:

That is the app:
SoundRec.aia (2.2 KB)

Try setting the path and filename of the recording yourself (using the block provided), still into the ASD, but ensure path has no spaces (this should be fixed, it works in companion...)

2 Likes

Thanks a lot TIM

If this is a known bug, and it will be fixed; then I prefer to wait than modifying the app.
(This recording is just an auxiliary part of the full app)

Would be interested to know if setting your own path fixes the problem when compiled

1 Like

Yes. You are right. When you set the paht and filename properly, it works fine (both in companion or built).
Tested in Android 4.4.4

@ewpatton

I understood that this was fixed in n188, it appears to be OK with companion app, but not when compiled ?

No, this will not work, because you have hard-coded the path for the APK and the path to Companion does not exists (on most devices).

Remove the folder /storage/emulated/0/AppInventor/ from your device and try again.

1 Like

No, this has not been fixed, either on the test server or on the main server.
(Checked on both with Android 9 and 12.)

1 Like

Ah, then this line in the release notes must refer to some other fix

  • Update all components that write files to follow new DefaultFileScope property in Screen1
1 Like

The regular path (and file name) for voice recording used to be something like:
storage/emulated/0/My Documents/Recordings/app_inventor_1638040020746.3gp

But now (I guess after nb188), the compiled app includes the ASD in the path, and tries to save it to (or tries to find it in):
storage/emulated/0/Android/data/appinventor.ai_martin_herraizh.DedoCarApp/files/My Documents/Recordings/app_inventor_1638040020746.3gp
But it can't, and gives you the mentioned error.

No problem with companion.

That was the test suggested by TIMAI2 (to check if it worked when forcing manually the path and file name).

It does work (at least in the specific device I'm using for testing).

The only caution you have to take before building the app, is change the variable Buit to "true"; (or leave it at "false" for testing with companion).

Maybe someone forgot that voice recording also writes (and reads) files, or some more testing needs to be done?

I deleted the folder (as you suggested).
Then I discovered that on execution companion creates it again.
But (right now) it does'nt write the voice recording files there. Instead it saves them to (sorry it's in German):
Lokaler Speicher/Gerätespeicher/Android/data/appinventor.ai_martin_herraizh.SoundRec/files.
That is: InternalDeviceStorage(Speicher/Gerätespeicher/)+ApplicationSpecificDirectory(Android/data/appinventor.ai_martin_herraizh.SoundRec/files)+FileName.ext)

I believe that's the new behaviour for the compiled app.
But is this also the way companion will behave from now on? (may be required for Android >10)

No, this folder is not created.
Also not on Android 4.x or Android 8, 9, 10, 11, 12.

1 Like