You're trying to use config API that does not exist. I couldn't find documentations for that section.
Solution for your case - write your custom plugin and modify gradle settings as string there. It is described here https://github.com/expo/eas-cli/issues/2743