Getting error while trying to migrate gradle 6.4.1 to 7.0.2.7

I am trying to migrate the gradle from version 6.4.1 to 7.0.2.7. I am getting the following error.
:ciaa:providedCompile was attempted from a context different the project context.

Please help me to resolve the error.