java - Gradle - 错误找不到参数的方法实现()[com.android.support :appcompat-v7:26. 0.0]

标签 java android android-studio android-gradle-plugin

我正在尝试在 android studio 中打开现有的 android 项目,它 gradle 无法在没有错误的情况下构建应用程序

android studio 不断抛出错误

Error:(74, 1) A problem occurred evaluating project ':app'.
> Could not find method implementation() for arguments 
[com.android.support:appcompat-v7:26.0.0] on object of type 
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

我在 build.gradle 中的代码有助于理解我的问题 我的依赖

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')

// google & support
implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "com.android.support:cardview-v7:$supportVersion"
implementation "com.android.support:recyclerview-v7:$supportVersion"
implementation "com.android.support:design:$supportVersion"
implementation "com.android.support:palette-v7:$supportVersion"
implementation "com.android.support:customtabs:$supportVersion"
implementation "com.android.support:support-v4:$supportVersion"
implementation 'com.google.android.exoplayer:exoplayer:r2.0.4'

// utils
implementation 'com.github.bumptech.glide:glide:4.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
implementation 'com.koushikdutta.ion:ion:2.1.7'
implementation 'com.github.Commit451:bypasses:1.0.4'
implementation 'com.jakewharton:butterknife:8.8.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.0'
implementation 'com.drewnoakes:metadata-extractor:2.9.1'
implementation "com.orhanobut:hawk:2.0.1"

}

请帮忙解决问题

最佳答案

确保在 android/app/build.gradle 中添加这些依赖项,而不是在 android/build.gradle 中。

关于java - Gradle - 错误找不到参数的方法实现()[com.android.support :appcompat-v7:26. 0.0],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45615474/

相关文章:

java - libGDX Box2D 在从地面掉落之前转身

java - Spring Boot 应用程序无法 Autowiring XML 配置

java - 这个模式/习语是什么?有什么好处?

java - 备份阵列

java - doAfterTerminate 和 doFinally 之间的区别

android-studio - adb.exe start-server failed——必要时手动运行

android - 如何在 Kotlin Jetpack Compose 中使用 rememberLauncherForActivityResult 读取文件?

android - seekTo() 函数在 VideoView 中不起作用

android - Android Studio Gradle同步无法解决

android - 导航组件中应有函数调用 'map(...)'