Error:Cannot configure the 'publishing' extension after it has been accessed

I have faced the same issue after upgrading to latest studio.

I am not sure about the root cause but what I did is

comment below line from volley build.gradle

apply from: 'bintray.gradle'

As I can see there many project are there in you dependencies. If possible comment same from all and try syncing again.


Same thing happened to me.

I am not a Gradle expert but my solution was a little bit less drastic. I just edited the bintray.gradle file by moving the line:

apply plugin: 'maven-publish'

just before the publishing action.

This problem seems to be related with this:

https://github.com/researchgate/gradle-release/issues/125


This error comes from volley module, I solved this problem by doing as follows: open volley module, find bintray.gradle file and change

publishing {
   publications {...}
}

to

publishing.publications {...}

then it will work just fine.