Unfortunately Expo no longer supports Expo SDK 35 and also EAS Build only worked from Expo SDK 41 onwards. (I am not sure if it still supports Expo SDK 41.)
Also, I suspect both Apple and Google will not allow you to submit apps built with such an old SDK anymore.
To fix this specific error you can delete /home/expo/.gradle/init.gradle in pre-install hook. Error is caused by the fact that we add init.gradle on our instances that is using features that were not available in the old Gradle versions.
But as @wodin already mentioned neither playstore nor app store will accept that old versions either way, and it’s highly unlikely that this is the last error you would face.