1

I was working on my project yesterday and everything was going fine. Today when I opened it up, it failed to build. I don't understand this because I did not touch my dependencies at all yesterday. I did all the things I could think of.

I rebuilt the project multiple times,cleaned it, invalidate cache / restart , sync project with gradle files and it still doesn't work. Please help!

My app level build.gradle build.gradle Error

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
user7164928
  • 49
  • 1
  • 2
  • 1
    Possible duplicate of [Still getting warning : Configuration 'compile' is obsolete and has been replaced with 'implementation'](https://stackoverflow.com/questions/48709870/still-getting-warning-configuration-compile-is-obsolete-and-has-been-replace) – Android Feb 23 '19 at 04:41

3 Answers3

2

In build.gradle, change every compile with implementation (in your first picture)

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
  • maybe because you repeat 2 times implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' – Marija Mitić Feb 23 '19 at 04:46
0

you have used two time dependency of below. remove one of them.

 implementation 'com.android.support:appcompat-v7:28.0.0'
Mayur Dabhi
  • 3,607
  • 2
  • 14
  • 25
0

I can't really tell what the proble is but I can give you a sequence of steps that can help you troubleshoot.

First, change all compile to implementation. Although this is not the reason why your gradle is failing to resolve, it can still give you insight into the problem.

Next, remove redundant dependencies. Remove dependencies if you don't need them. This would help lighten the load so that you have a narrow list of dependencies to debug. Also, I couldn't help but notice that you have two support libraries. Remove one.

Next, look at the part of your build.gradle file that is highlighted (for example, the classpath). These are warnings/recommendations. If you hover around them, you'd see suggestions from android studio telling you what you could do better. Follow all of these instructions to the letter. Most of them would advise you to make the versions of all your dependency tally. Obey.

Finally, after doing all of this, I'm pretty sure the problem would have been solved. You can simply clean the project after all of this.

I really hope this works for you.. Merry coding!

Taslim Oseni
  • 6,086
  • 10
  • 44
  • 69
  • Also, @Praveen P's answer might also be useful. You need to add Google's google() repository in your project's gradle while using support libraries >= 26.0.0 or gradle build tools plugin version >= 3.0.0. – Taslim Oseni Feb 23 '19 at 07:53