我是Android应用程序开发新手。我正在尝试使用TabLayout创建一个Android应用程序,并在build.gradle文件中添加了以下依赖项。Gradle同步失败:无法找到方法compile()参数[com.android.support:appcompat-v7:25.3.1]
dependencies {
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'
}
但上运行的应用程序,我得到如下
Error:(27, 0) Gradle DSL method not found: 'compile()' Possible causes:
The project 'MyFirstapp' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file The build file may be missing a Gradle plugin. Apply Gradle plugin
为什么这个问题有什么建议,建立自己的错误。我可以从Android Studio安装插件,但我不知道要安装哪个插件。
http://stackoverflow.com/questions/27156428/getting-error-gradle-dsl-method-not-found-compile-when-syncing-build-grad – Steve