bhandaribhuminpfizer opened a new issue #304:
URL: https://github.com/apache/cordova-plugin-media/issues/304
# Bug Report
When i was trying to use `this.file.externalApplicationStorageDirectory` got
ERROR:
```
2021-04-26 11:46:44.763 31958-31958/APPID D/ViewRootImpl:
enqueueInputEventMotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0,
x[0]=474.0, y[0]=1412.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0,
classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1,
historySize=0, eventTime=51768622, downTime=51768622, deviceId=3,
source=0x1002, displayId=0 }
2021-04-26 11:46:44.847 31958-32347/APPID V/Diagnostic: Get authorisation
status for android.permission.RECORD_AUDIO
2021-04-26 11:46:44.894 31958-31958/APPID I/chromium: [INFO:CONSOLE(3093)]
"res
{"isFile":true,"isDirectory":false,"name":"recordX.wav","fullPath":"/Android/data/APPID/recordX.wav","filesystem":"<FileSystem:
sdcard>","nativeURL":"file:///storage/emulated/0/Android/data/APPID/recordX.wav"}",
source: http://localhost/build/main.js (3093)
2021-04-26 11:46:44.904 31958-31958/APPID I/chromium: [INFO:CONSOLE(3095)]
"fileres.nativeURL file:///storage/emulated/0/Android/data/APPID/recordX.wav",
source: http://localhost/build/main.js (3095)
2021-04-26 11:46:44.908 31958-31958/APPID I/chromium: [INFO:CONSOLE(3103)]
"recordingMediaObject
{"_objectInstance":{"id":"9452daed-9803-6f61-b0a8-7ae27741eb3b","src":"file:///storage/emulated/0/Android/data/APPID/recordX.wav","_duration":-1,"_position":-1},"onSuccess":{"_isScalar":false},"onError":{"_isScalar":false},"onStatusUpdate":{"_isScalar":false}}",
source: http://localhost/build/main.js (3103)
2021-04-26 11:46:44.911 31958-32347/APPID E/CheckPermission:
media_record-code= 24
2021-04-26 11:46:44.911 31958-32347/APPID I/MediaRecorder: setAudioSource()
as = 1
2021-04-26 11:46:44.911 31958-32347/APPID I/MediaRecorder: init()
2021-04-26 11:46:44.911 31958-32347/APPID E/CheckPermission:
media_record-code= 2
2021-04-26 11:46:44.911 31958-32347/APPID E/CheckPermission:
media_record-code= 23
2021-04-26 11:46:44.916 31958-32347/APPID E/CheckPermission:
media_record-code= 12
2021-04-26 11:46:44.918 31958-32347/APPID I/MediaRecorder: setOutputFormat()
of = 6
2021-04-26 11:46:44.918 31958-32347/APPID E/CheckPermission:
media_record-code= 13
2021-04-26 11:46:44.918 31958-32347/APPID I/MediaRecorder: setAudioEncoder()
ae = 3
2021-04-26 11:46:44.918 31958-32347/APPID E/CheckPermission:
media_record-code= 15
2021-04-26 11:46:44.923 31958-32347/APPID D/MediaRecorder: mHypnusCtrl is
true
2021-04-26 11:46:44.930 31958-32347/APPID E/CheckPermission:
media_record-code= 16
2021-04-26 11:46:44.935 31958-32347/APPID I/MediaRecorder: prepare()
2021-04-26 11:46:44.935 31958-32347/APPID E/CheckPermission:
media_record-code= 9
2021-04-26 11:46:44.935 31958-32347/APPID I/MediaRecorder: start() enter +++
2021-04-26 11:46:44.935 31958-32347/APPID E/CheckPermission:
media_record-code= 8
2021-04-26 11:46:45.025 31958-32347/APPID I/MediaRecorder: start() end; use
totalTime = 90095 Us
2021-04-26 11:46:45.026 31958-32347/APPID W/PluginManager: THREAD WARNING:
exec() call to Media.startRecordingAudio blocked the main thread for 118ms.
Plugin should use CordovaInterface.getThreadPool().
2021-04-26 11:46:48.660 31958-31958/APPID D/ViewRootImpl:
enqueueInputEventMotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0,
x[0]=463.0, y[0]=1602.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0,
classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1,
historySize=0, eventTime=51772518, downTime=51772518, deviceId=3,
source=0x1002, displayId=0 }
2021-04-26 11:46:48.728 31958-32347/APPID V/Diagnostic: Get authorisation
status for android.permission.RECORD_AUDIO
2021-04-26 11:46:48.734 31958-32347/APPID I/MediaRecorder: stop()
2021-04-26 11:46:48.735 31958-32347/APPID E/CheckPermission:
media_record-code= 7
2021-04-26 11:46:48.803 31958-32347/APPID I/MediaRecorder: reset()
2021-04-26 11:46:48.803 31958-32347/APPID D/AudioPlayer: stopping recording
2021-04-26 11:46:48.804 31958-32347/APPID D/AudioPlayer: size = 1
2021-04-26 11:46:48.804 31958-32347/APPID D/AudioPlayer: renaming
/storage/emulated/0/tmprecording-1619417804923.3gp to
/storage/emulated/0/Android/data/APPID/recordX.wav
2021-04-26 11:46:48.804 31958-32347/APPID V/ActivityThread: Recovering
failed rename /storage/emulated/0/tmprecording-1619417804923.3gp to
/storage/emulated/0/Android/data/APPID/recordX.wav
2021-04-26 11:46:48.876 31958-32347/APPID W/PluginManager: THREAD WARNING:
exec() call to Media.stopRecordingAudio blocked the main thread for 142ms.
Plugin should use CordovaInterface.getThreadPool().
2021-04-26 11:46:48.878 31958-32347/APPID I/MediaRecorder: release()
2021-04-26 11:46:48.878 31958-32347/APPID E/CheckPermission:
media_record-code= 1
```
## Problem
**Not able to record file**
### What is expected to happen?
Record File and play from externalApplicationStorageDirectory
### What does actually happen?
Not able to record into externalApplicationStorageDirectory
## Information
Try to add android:requestLegacyExternalStorage on config.xml but not
Resolve.
<platform name="android">
..
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge"
target="/manifest/application">
<application android:requestLegacyExternalStorage="true" />
</edit-config>
...
### Command or Code
<!-- What command or code is needed to reproduce the problem? -->
### Environment, Platform, Device
<!-- In what environment, on what platform or on which device are you
experiencing the issue? -->
### Version information
> "@ionic-native/media": "4.20.0",
> "cordova-plugin-media": "5.0.3",
```
Ionic:
Ionic CLI : 5.4.16
(/Users/user/.nvm/versions/node/v12.14.1/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.9
@ionic/app-scripts : 3.2.3
Cordova:
Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : android 9.0.0, ios 6.2.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0,
cordova-plugin-ionic-webview 5.0.0, (and 19 other plugins)
Utility:
cordova-res (update available: 0.15.3) : 0.15.1
native-run : 1.3.0
System:
Android SDK Tools : 26.1.1 (/Users/user/Library/Android/sdk)
ios-deploy : 1.11.4
ios-sim : 8.0.2
NodeJS : v12.14.1
(/Users/user/.nvm/versions/node/v12.14.1/bin/node)
npm : 6.13.4
OS : macOS Big Sur
Xcode : Xcode 12.4 Build version 12D4e
```
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [ x ] I searched for existing GitHub issues
- [ x ] I updated all Cordova tooling to most recent version
- [ x ] I included all the necessary information above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]