RECORD_AUDIO error when the permissions = [ ]

Hi,
My Android permissions config in app.json is “permissions”: [ ]
I have installed expo-av package which I only use for playing sounds.
I build my app with Classic Expo and EAS.
When I upload the Classic Expo-built app on Google Play Console’s Internal Testing, I don’t get any permissions error.
But when I build the same app with EAS build, I get a “Your APK or Android App Bundle is using permissions that require a privacy policy: (android.permission.RECORD_AUDIO).” error on Google Play Console.

Is this a bug in EAS Build?
Any help is appreciated, thanks!

The classic build system does automatically handle some Android-related permissions for you, but EAS should actually handle this better. If you’re using the expo-av config plugin, then this permission is added to AndroidManifest by default- expo/withAV.ts at e0bb254c889734f2ec6c7b688167f013587ed201 · expo/expo · GitHub but you can always remove it

@charliecruzan
So, I’ve ejected and changed my AndroidManifest.xml at android/app/src/main/AndroidManifest.xml

I’ve then followed the instructions at https://docs.expo.io/versions/latest/sdk/permissions/#excluding-android-permissions-in-bare-workflow

The file contents now are

<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.rakshithxaloori.guitarstrumchordchanges">
  <uses-permission tools:node="remove" android:name="android.permission.RECORD_AUDIO" />
  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
  <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
  <uses-permission android:name="android.permission.VIBRATE"/>
  <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  <uses-permission android:name="android.permission.WAKE_LOCK"/>
  <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
  <application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme">
    <meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/@rakshith.aloori/guitar-chord-changes"/>
    <meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="41.0.0"/>
    <meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
    <meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
    <meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
    <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
      <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme="com.rakshithxaloori.guitarstrumchordchanges"/>
      </intent-filter>
    </activity>
    <activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
  </application>
</manifest>

I’ve then tried building the app with eas build --platform android command.

Then I’ve uploaded the .aab file on Google Play Console’s Internal Testing, but the “Your APK or Android App Bundle is using permissions that require a privacy policy: (android.permission.RECORD_AUDIO).” error still persists

Have I made an error anywhere?

can you share what packages you are using? some permissions are automatically added based on packages

@notbrent yeah sure

"dependencies": {
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/slider": "^3.0.3",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.5",
    "expo": "^41.0.1",
    "expo-av": "~9.1.2",
    "expo-cli": "^4.4.8",
    "expo-constants": "^10.1.3",
    "expo-notifications": "~0.11.6",
    "expo-splash-screen": "~0.10.2",
    "expo-status-bar": "~1.0.4",
    "expo-updates": "~0.5.4",
    "prop-types": "^15.7.2",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "~0.63.4",
    "react-native-app-intro-slider": "^4.0.4",
    "react-native-flash-message": "^0.1.23",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-push-notification": "^7.3.1",
    "react-native-reanimated": "~2.1.0",
    "react-native-safe-area-context": "^3.2.0",
    "react-native-screens": "^3.1.1",
    "react-native-svg": "^12.1.1",
    "react-native-unimodules": "~0.13.3",
    "react-native-vector-icons": "^8.1.0",
    "react-native-web": "~0.13.12"
  },
  "devDependencies": {
    "@babel/core": "^7.9.0"
  },

These are the dependencies after ejecting

@charliecruzan @notbrent I may have found something weird


In the first picture, we can see that I explicitly asked to remove some permissions. But we can see in the second picture, that those permissions are still not removed.
Until version code 7, I built the app with Classic Expo Build. These issues started when I switched to EAS Build.

I’ve tried a few things but the permissions that are not needed were still there with the EAS Build. The Classic Build works perfectly, the only issue being the size of the app. So as of now, I will be using the Classic Expo Build.

I hope you will fix the issue soon :smiley:

expo-av will add the record audio permission because audio recording is included in that package, we’ll need to provide a way to opt out of that.

read phone state is added by default right now but it should not be, we’ll resolve that soon.

write external storage comes from expo-file-system

How do you remove that permission? I’m using managed workflow and eas build. Can’t find a working solution.

Hi. See this thread for a workaround: