Error:(30, 0) Could not find method compile() for arguments

前端 未结 2 922
萌比男神i
萌比男神i 2020-12-21 10:55

I get this error. I\'m pretty confused because i check everything in sdk manager and it\'s all updated (i think so).

Error:(30, 0) Could not find meth

2条回答
  •  死守一世寂寞
    2020-12-21 11:24

    You should not use "compile" when using Gradle build tools 3.0.0.

    "compile" has been replaced with "implementation".

    And you can't add dependencies in the project build.gradle file.
    You have to add dependencies in the module build.gradle file.

    So in the build.gradle file in the "app" directory, add these lines:

    dependencies {
        implementation 'com.android.support:appcompat-v7:+'
    }
    

    The "dependencies" block might already be there, if so, just add the contents to the original block.

提交回复
热议问题