Getting Error “Gradle DSL method not found: 'compile()'” when Syncing Build.Gradle

后端 未结 10 817
后悔当初
后悔当初 2020-11-30 09:42

\"Error\"project

10条回答
  •  -上瘾入骨i
    2020-11-30 10:29

    In almost all cases, your dependencies should be put into the individual module's build.gradle files rather than at the top most level build.gradle file. In your case, that means the dependency should be added to the app module's build.gradle file:

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile "com.android.support:support-v4:18.0.+"
    }
    

    And you should remove the entire allprojects part of the top level build.gradle.

提交回复
热议问题