You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/04/26 06:27:43 UTC

[GitHub] [cordova-plugin-media] bhandaribhuminpfizer opened a new issue #304: Android 11 Error CheckPermission: media_record-code= 24

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 (cordova-lib@9.0.1)
      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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-media] dlazzy commented on issue #304: startRecord() Error CheckPermission: media_record-code= 24: Android 11

Posted by GitBox <gi...@apache.org>.
dlazzy commented on issue #304:
URL: https://github.com/apache/cordova-plugin-media/issues/304#issuecomment-831715146


   Thanks for the tips but no changes :/
   
   I found that https://github.com/apache/cordova-plugin-file/issues/426#issuecomment-830841544 this guy made a fork of file plugin, but this does not work too. In my plugin.xml there is no such lines like "requestLegacyExternalFlag" even with lastest version.


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-media] bhandaribhuminpfizer closed issue #304: startRecord() Error CheckPermission: media_record-code= 24: Android 11

Posted by GitBox <gi...@apache.org>.
bhandaribhuminpfizer closed issue #304:
URL: https://github.com/apache/cordova-plugin-media/issues/304


   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-media] bhandaribhuminpfizer edited a comment on issue #304: startRecord() Error CheckPermission: media_record-code= 24: Android 11

Posted by GitBox <gi...@apache.org>.
bhandaribhuminpfizer edited a comment on issue #304:
URL: https://github.com/apache/cordova-plugin-media/issues/304#issuecomment-831252822


   @dlazzy  did you try to change type to `.m4a` it should work. 
   also don't forgot to add 
   ```
     <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
               <application android:requestLegacyExternalStorage="true" />
           </edit-config>
   ```


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-media] bhandaribhuminpfizer edited a comment on issue #304: startRecord() Error CheckPermission: media_record-code= 24: Android 11

Posted by GitBox <gi...@apache.org>.
bhandaribhuminpfizer edited a comment on issue #304:
URL: https://github.com/apache/cordova-plugin-media/issues/304#issuecomment-831953630


   @dlazzy you may need to add this in config.xml
   
   ```
     <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
               <application android:requestLegacyExternalStorage="true" />
           </edit-config>
   ```
   
   try  `this.file.createFile(his.file.externalApplicationStorageDirectory, this._fileName, true).then(res => {` Should work


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-media] bhandaribhuminpfizer commented on issue #304: startRecord() Error CheckPermission: media_record-code= 24: Android 11

Posted by GitBox <gi...@apache.org>.
bhandaribhuminpfizer commented on issue #304:
URL: https://github.com/apache/cordova-plugin-media/issues/304#issuecomment-831252822


   @dlazzy  dis you try to change type to `.m4a` it should work. 
   also don't forgot to add 
   ```
     <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
               <application android:requestLegacyExternalStorage="true" />
           </edit-config>
   ```


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-media] dlazzy commented on issue #304: startRecord() Error CheckPermission: media_record-code= 24: Android 11

Posted by GitBox <gi...@apache.org>.
dlazzy commented on issue #304:
URL: https://github.com/apache/cordova-plugin-media/issues/304#issuecomment-831236248


   Same issue here, getting an error code: 1 for Android >= 10.
   
   Trying to add `android:requestLegacyExternalStorage on config.xml` did not help because I'm using an old `cordova-android` version (because my app use lots of plugins and they didn't get updated). So like @bhandaribhuminpfizer my app is stuck with this error. This will create serious problem when PlayStore will required API target 30.
   
   I tried to use media-capture, but this open another app to record audio. Also tried to use memory instead of a temporary file, without success.
   
   ```
   cli packages:
   
       @ionic/cli-utils  : 1.19.2
       ionic (Ionic CLI) : 3.20.0
   
   global packages:
   
       cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1) 
   
   local packages:
   
       @ionic/app-scripts : 3.2.4
       Cordova Platforms  : android 6.3.0
       Ionic Framework    : ionic-angular 3.9.9
   
   System:
   
       Android SDK Tools : 26.1.1
       Node              : v7.8.0
       npm               : 4.2.0 
       OS                : Linux 5.8
   
   Misc:
   
       backend : pro
   
   cordova-plugin-file: 6.0.2
   cordova-plugin-media: 5.0.3
   ```


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-media] francoisduchemin commented on issue #304: startRecord() Error CheckPermission: media_record-code= 24: Android 11

Posted by GitBox <gi...@apache.org>.
francoisduchemin commented on issue #304:
URL: https://github.com/apache/cordova-plugin-media/issues/304#issuecomment-846514133


   This solution with the "requestLegacyExternalStorage" is soon going to be an issue.
   
   https://developer.android.com/about/versions/11/privacy/storage
   
   If I understand correctly, our apps won't be able to write to the external directory so easily anymore...


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-media] dlazzy edited a comment on issue #304: startRecord() Error CheckPermission: media_record-code= 24: Android 11

Posted by GitBox <gi...@apache.org>.
dlazzy edited a comment on issue #304:
URL: https://github.com/apache/cordova-plugin-media/issues/304#issuecomment-831715146


   Thanks for the tips but no changes :/
   
   I found that https://github.com/apache/cordova-plugin-file/issues/426#issuecomment-830841544 this guy made a fork of file plugin, but this does not work too. In my plugin.xml there is no such lines like "requestLegacyExternalFlag" even with lastest version.
   
   Anyway my error code is : 1
   Yours is `media_record-code= 24` (also 1 as I see in your logs)
   
   I think there is multiple problems, on my side I don't know how to resolve them.


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-media] bhandaribhuminpfizer commented on issue #304: startRecord() Error CheckPermission: media_record-code= 24: Android 11

Posted by GitBox <gi...@apache.org>.
bhandaribhuminpfizer commented on issue #304:
URL: https://github.com/apache/cordova-plugin-media/issues/304#issuecomment-831953630


   @dlazzy you may need to add this in config.xml
   
   ```
     <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
               <application android:requestLegacyExternalStorage="true" />
           </edit-config>
   ```


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org