0

I'm having an issue relatively to gradle which I don't know how to solve it...

If I put this command on my terminal : gradle --scan :<module A>:debugCompileClasspath

This is what it shows me :

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project '<root_project_file>'.
> Could not resolve all files for configuration ':classpath'.
> Could not find gradle-core.jar (com.android.tools.build:gradle-core:3.1.2).
 Searched in the following locations:
     https://plugins.gradle.org/m2/com/android/tools/build/gradle-core/3.1.2/gradle-core-3.1.2.jar
> Could not find layoutlib-api.jar (com.android.tools.layoutlib:layoutlib-api:26.1.2).
 Searched in the following locations:
     https://plugins.gradle.org/m2/com/android/tools/layoutlib/layoutlib-api/26.1.2/layoutlib-api-26.1.2.jar

How can I solve this ?

P.S: My Gradle Android plugin is 3.1.2 and gradle version : distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

P.S.2 : Clearing the cache of gradle, now disappears those errors but i have this problem now ... Task 'debugCompileClasspath' not found in project ':<Module_porject>'.

Damiii
  • 1,363
  • 4
  • 25
  • 46
  • https://stackoverflow.com/a/47216956/9025311 –  May 28 '18 at 13:05
  • @Eminem now my problem is different ! – Damiii May 28 '18 at 13:23
  • what changed?.. –  May 28 '18 at 13:59
  • @Eminem just cleared the cache of Gradleby doing those commands : ` rm -rf $HOME/.gradle/caches ` and `./gradlew cleanBuildCache` – Damiii May 28 '18 at 14:02
  • I think that you have a dependency problem,take a look at this question and answers https://stackoverflow.com/a/47399070/9025311 –  May 28 '18 at 14:06
  • @Eminem did that too – Damiii May 28 '18 at 14:13
  • I haven't updated my AS yet, however I encourage you to try all the answers,most recent post regarding this prb is https://stackoverflow.com/questions/44218614/gradle-4-0-unable-to-find-a-matching-configuration hope it helps –  May 28 '18 at 15:33
  • 1
    @Eminem I guess I have no others option. I'll try and keep informed :) Thank you – Damiii May 28 '18 at 15:36

1 Answers1

0

So.... It seems that jcenter() repository had some problems recently (server issues), which means that gradle was having some conflicts to build the project... I checked the status of bintray in twitter and waited that the problem was solved, then I cleared the cache of gradle in my computer (mac os) with those commands :

rm -rf $HOME/.gradle/caches
./gradlew cleanBuildCache

Finally, the project was building everything correctly with no errors ! Hope it will help the next adventurers. Cheers :)

Damiii
  • 1,363
  • 4
  • 25
  • 46