how to prevent sdk from reading android id

Please provide the following:

  1. SDK Version: 46.0.16
  2. Platforms(Android/iOS/web/all): android
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

I want to put my app on the store but the privacy policy doesn’t allow the app to read the android id before the user allows it.I would like to know how to stop the sdk from reading the android id.

This is the call stack of the function, I don’t actively use the android id myself, but this seems to be the behavior that happens inside the expo, I would like to know how to prevent it from reading by default?


node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt

I seem to find the source of the read behavior, but it’s in node_module and I can’t actively modify it (I tried commenting it out, but it doesn’t seem to work)

Hi @lopo12123

How are you building the app? With npx expo build:android or eas build -p android?

If you were doing it with npx expo build:android, try switching to EAS Build.

I’m not 100% sure what you’re referring to, but EAS Build will only include the dependencies you actually have listed in your package.json, whereas expo build will include all native code needed by the Expo SDK, which could include code for reading IDs that you do not actually want/need.

thanks for reply. i`m using ‘eas build’, i think the behavior of reading ‘androidId’ comes from one of ‘expo-…’ libraries. anyway, i can`t prevent it and finally i add a screen using java before all the react-native project start loading. it works well (at least i think :grinning:)