After upgrading to Android Studio 3.1.2 I am getting the following error:
Configuration on demand is not supported by the current version of the Andro
Invalidate cache and restart/disabling configure on demand did not work for me. The only solution that helped me is to import the project from git again.
[UPD] Need to change "com.android.tools.build:gradle" from 3.1.2 to 3.1.1