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

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

更新Android Studio后出现此错误。

这是我的app.gradle


apply plugin: 'com.android.application'



android {


compileSdkVersion 23


buildToolsVersion '23.0.2' 



defaultConfig {


 minSdkVersion 14


 targetSdkVersion 23


 versionCode 1


 versionName"1.0"


 vectorDrawables.useSupportLibrary = true


 generatedDensities = []


}


aaptOptions {


 additionalParameters"--no-version-vectors"


}


buildTypes {


 release {


 minifyEnabled false


 proguardFiles getDefaultProguardFile('proguard-android.txt'), proguard-rules.pro'


 }


}


dexOptions {


 preDexLibraries = false


 javaMaxHeapSize"4g"


 }


}


dependencies {


compile fileTree(include: ['*.jar'], dir: 'libs')


compile files('libs/universal-image-loader-1.9.5.jar')


compile project(':databaseAutoCompleteLibrary')


compile 'com.google.code.gson:gson:2.2.4'


compile 'com.android.support:support-v4:23.2.0'


compile 'com.android.support:gridlayout-v7:23.2.0'


compile 'com.loopj.android:android-async-http:1.4.9'


compile 'com.jakewharton:butterknife:7.0.1'


compile 'com.baoyz.swipemenulistview:library:1.3.0'


compile 'milyn:opencsv:1.6'


compile 'de.hdodenhof:circleimageview:2.0.0'


compile project(':MPChartLib')


compile project(':filechooserlibrary')


//compile 'com.android.support:support-v4:18.0.0'


//compile 'com.android.support:appcompat-v7:18.0.+'


compile 'com.android.support:design:23.2.0'


compile 'com.android.support:support-v13:23.2.0'


compile 'com.android.support:appcompat-v7:23.2.0'


compile 'com.squareup.picasso:picasso:2.5.2'


compile 'com.mcxiaoke.volley:library:1.0.19'


compile project(':Volley')


compile 'com.google.android.gms:play-services:8.4.0'


}



请提供解决方案,我正在使用Volley库。 谢谢

时间:

升级到最新的studio后,我遇到了同样的问题。

我不确定根本原因,但我做的是

注释volley中的build.gradle下面行


apply from: 'bintray.gradle'



我也发生了同样的事情。

我不是Gradle专家,但是,我的解决方案不那么激烈了。我只是编辑了bintray.gradle文件:


apply plugin: 'maven-publish'



只是在发布之前。

此问题似乎与以下问题有关:

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

此错误来自Volley模块,我通过如下方式解决了此问题: 打开Volley模块,查找bintray.gradle文件,并且更改,


publishing {


 publications {...}


}




publishing.publications {...}



那它就能正常工作。

...