android - 错误:未找到 Gradle DSL 方法:'implementation()' 但我有最新的 Android Studio,gradle,
问题描述
我只想执行'de.hdodenhof:circleimageview:3.0.0'
使图像变圆。但我不能
我尝试更新所有内容
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
implementation 'de.hdodenhof:circleimageview:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
解决方案
您编辑了错误的build.gradle
文件。您添加的正下方的行警告您不要这样做:
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
如果您有一个典型的 Android Studio 项目,请将您的项目implementation 'de.hdodenhof:circleimageview:3.0.0'
从您拥有的位置移至文件中的dependencies
闭包app/build.gradle
。
推荐阅读
- java - 错误:(4, 46) java: 包 org.springframework.boot.autoconfigure 不存在
- python - 如何在 Keras 模型的自定义损失中访问张量的内容
- python - Python Wand - 作物比例?
- python - 在 NumPy 中计算一个序列的经验分布?
- r - purrr:按(巢)和引导分组
- r - 如果数据框列中的变量名称与向量重命名变量中的名称匹配
- sql-server - SQL Server 聚集索引
- jenkins - Jenkins - 无法使用“构建作业”命令访问从另一个构建管道中的一个构建管道发送的参数
- javascript - 谷歌地图 fitBounds 无法在模式内的地图上工作
- javascript - 使用 websocket 将客户端连接到服务器