错误:访问后无法配置“发布”扩展

时间:2016-03-18 08:22:36

标签: android android-studio android-gradle

错误:访问后无法配置“发布”扩展程序。

我在更新我的android工作室后收到此错误。

这是我的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'
}

请提供任何解决方案。 我正在使用排球库。 感谢。

4 个答案:

答案 0 :(得分:17)

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

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

在volley build.gradle

下面的注释
apply from: 'bintray.gradle'

正如我所看到的那样,依赖项中存在许多项目。 如果可能的话,请对所有人进行同样的评论并再次尝

答案 1 :(得分:17)

同样的事发生在我身上。

我不是Gradle专家,但我的解决方案有点不那么激烈了。我刚刚通过移动行编辑了bintray.gradle文件:

apply plugin: 'maven-publish'

publishing行动之前。

这个问题似乎与此有关:

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

答案 2 :(得分:14)

这个错误来自凌空模块,我通过以下方式解决了这个问题: 打开排球模块,找到bintray.gradle文件并更改

publishing {
   publications {...}
}

publishing.publications {...}

然后它会正常工作。

答案 3 :(得分:0)

当我不经意地在模块之间引入循环依赖时,我现在就知道了,以防将来有人碰到它。