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

元气小坏坏 提交于 2019-11-29 16:23:40

You can't use the compile() DSL in the top level file.

Delete this block:

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

and add the dependency in the dependencies block inside the app/build.gradle file.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!