Its possible you are trying to change the ‘configuration.provided’ object inside of a ‘doLast’ or ‘doFirst’ block. Also make sure you did not accidentally add a ‘<<’ (left-shift) at the top of your task definition when you are trying to configure the task. This is the same as a ‘doLast’.
This will happen if you’re using the ‘+=’ operator to modify IDEA scopes, or if you’re using a plugin that does so. (I think some popular 3rd party plugins were using this syntax).