0

Here is my code, that I want to insert in build.grandle so I can work on my project:

compile 'com.android.support: design: 25.3.1'
compile 'com.android.support: recyclerview-v7:25.3.1'
compile 'com.getbase:floatingactionbutton:1.9.0'
compile 'com.wdullaer:materialdatetimepicker:1.2.1'
compile 'com.bignerdranch.android:recyclerview-multiselect:+'
compile 'com.wrapp.floatlabelededittext:library:0.0.6'

When I try to Sync it's sais that:

ERROR: Failed to resolve: com.android
Affected Modules: app


WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app

And then the "implementation 'com.android.support:appcompat-v7:28.0.0-rc02'" line goes under red line.

Sorry about my English, I hope you understand my problem. I am a beginner with the Android Studio so easy on me pls :D

Darshan
  • 4,020
  • 2
  • 18
  • 49
Cam
  • 61
  • 6
  • 1
    https://stackoverflow.com/questions/44413952/gradle-implementation-vs-api-configuration – Pawel Jul 10 '19 at 22:46
  • 6
    Possible duplicate of [Gradle Implementation vs API configuration](https://stackoverflow.com/questions/44413952/gradle-implementation-vs-api-configuration) – computercarguy Jul 10 '19 at 22:49

1 Answers1

0

There shouldn't be any spaces before/after the ':'. Check and remove the spaces in your compile lines, and you should be able to sync your project with gradle files properly. So, for example in the code you pasted, you should remove the spaced before design and recycler.

compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'

P.S - Take a look at the link provided in the comment to get a proper understanding of compile, implementation and api.

Chrisvin Jem
  • 3,940
  • 1
  • 8
  • 24
  • Now I got another problem whit this 2 lines after I delete the spaces between them. I read the link in the comments but I still don't get it what should I do with my project and what exactly my problem is. – Cam Jul 11 '19 at 08:34
  • Now I realized that my problem was the version number. I change the design and the recyclerview version to 28.0.0 and instead of compile I write implementation. It's working now, but still don't have a clue what is the difference between api, implementaion and compile. Except that one of them is more faster then the others, right? – Cam Jul 11 '19 at 08:47
  • 1
    `implementation` is faster than the other's because of how it works, but you should try and understand why that is so. `implementation` doesn't leak it's dependencies like `api` and `compile` do. – Chrisvin Jem Jul 11 '19 at 09:27
  • 1
    A simple rule of thumb would be to replace all `compile` with `implementation`, if there are any errors (usually cases where leaking dependencies where expected) then you can change it to 'api'. – Chrisvin Jem Jul 11 '19 at 09:28