Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

I am getting this error after updating my android studio.

this is my 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'
}

please provide any solution. I am using volley library. Thanks.

like image 387
user6076314 Avatar asked Mar 18 '16 08:03

user6076314


3 Answers

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.

like image 58
Drup Desai Avatar answered Nov 16 '22 08:11

Drup Desai


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

like image 27
omrsin Avatar answered Nov 16 '22 06:11

omrsin


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.

like image 21
GeorgeBinDragon Avatar answered Nov 16 '22 06:11

GeorgeBinDragon