Gradle DSL method not found: 'implementation()'

前端 未结 9 2135
礼貌的吻别
礼貌的吻别 2020-11-28 14:29

I had this error

Error:(45, 0) Gradle DSL method not found: \'implementation()\'
Possible causes:
  • The project \'LaTaxi2\' may be using a
9条回答
  •  北海茫月
    2020-11-28 14:49

    I had such a simple reason for this not working that I must post my answer to prevent anybody else going through this.

    Don't put repositories and dependencies in the file called build.gradle (Project: YourProjectName)! There is a comment in that file that says:

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    

    Good job to whoever put that note in there. Instead, place your repositories and dependencies in the similarly named module file build.gradle (Module: app).

    There should already be a dependencies function. You may need to add repositories function. In my case, it was:

    repositories {
        maven { url "https://jitpack.io" }
    }
    

    This should let you sync and recognize implementation.

提交回复
热议问题