skip to Main Content

I am trying to use flutter_sound to record some audio and also use permission_handler to request permission for audio. However, I get this error No permissions found in manifest for: []33

Here is the setup for android

androidappsrcmainAndroidManifest

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />  
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>  

In build.gradle, I have

defaultConfig {
        applicationId "com.example"
        minSdkVersion flutterMinSdkVersion.toInteger()
        targetSdkVersion flutterTargetSdkVersion.toInteger() // 33 in local.properties
        compileSdkVersion flutterCompileSdkVersion.toInteger() // 33 in local.properties
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

Here is the code I request permission and start recording

var status = await Permission.audio.status;
    if (!status.isGranted || !status.isPermanentlyDenied) {
      await Permission.audio.request();
    }

    if (!status.isGranted || !status.isPermanentlyDenied) {
      return false;
    }

    await openRecorderSession();

    if (_recorder != null && isRecordingStopped()) {
      await _recorder?.startRecorder(
        toFile: path,
        codec: Codec.aacMP4,
      );

      return true;
    }

2

Answers


  1. You can try this two permissions :

    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION"/>
    
    Login or Signup to reply.
  2. <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/> 
    <uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
    <uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>
    

    you can use this permission for read media according to this android doc https://developer.android.com/about/versions/13/behavior-changes-13

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search