Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle sync issue : None of the consumable configurations have attributes

Tags:

android

gradle

I wan't to use an external library in my project. The fact is that it doesn't behave as I want, so I need to edit classes of it.

To do this, I downloaded the library as a zip folder and added it to my project using this technique How do you edit a dependency/external library in android studio?

After the project sync, I get this in gradle console:

gradle error console And here is the detail of one of those errors :

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :libs:Markwon.

Could not resolve project :libs:Markwon. Required by: project :app Unable to find a matching configuration of project :libs:Markwon: None of the consumable configurations have attributes.

I tried lot of things, like setting same buildTypes names in app build.gradle and external library build.gradle like said in threads I found about this problem. I tried with another library and result was the same.

I really don't get it guys, if you have an idea about this problem, or another solution to edit my external library, I would appreciate so much.

like image 252
BNY Avatar asked May 15 '18 18:05

BNY


People also ask

Why is my gradle not syncing?

In some cases when your Gradle files are deleted or corrupted you will not be able to download new Gradle files in android studio. In this case, we have to delete the Gradle files which are present already and then again sync your project to download our Gradle files again.


1 Answers

(This text was moved from the question as per Jonathan Landrum's request)

After hours of hair pulling I found it. The problem was basically that my library project A was composed of 3 sub projects B, C and D

So initially I was trying to include the main library folder this way and compile it all

include ':libs:A' 

in settings.gradle and compile it like this

implementation project(':libs:A')

in build.gradle

So the good solution was

implementation project(':libs:A:B')

as the B project was the actual library I needed.

like image 58
2 revs, 2 users 89% Avatar answered Sep 28 '22 00:09

2 revs, 2 users 89%