java - Gradle 方法未找到:'compile' 可能的原因:项目
问题描述
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
我正在尝试将编译方法添加到 build.gradle 但我遇到了这个问题我有 android studio 3.5.2
和 5.4.1 gradle
解决方案
您可以替换compile
为implementation
:
implementation 'com.android.support:appcompat-v7:24.1.1'
implementation 'com.android.support:design:24.1.1'
但是您将依赖项放入build.gradle
模块项目中。将它们放在build.gradle
模块应用程序中。
推荐阅读
- c++ - 传递`-l
`与传递`lib .a` 直接连接到链接器? - tensorflow - 在 tensorflow 2.0 中的自定义损失和梯度代码中获取全无梯度
- python - 信号获取多个 Qcombox 的多个内容作为函数中的多个参数
- node.js - Redis 连接丢失,没有任何迹象
- sql-server - 从存储在 varbinary 字段中的图像的中点获取字节并确定 HTMLColor
- amazon-web-services - 如何在 AWS Clouformation 中使用可用区信息创建名称标签?
- java - 如何在 JDA 中的不同游戏状态消息之间循环?
- ios - “24:00”字符串中的 DateFormatter 返回 Nil
- javascript - 如何在 RxJS 中根据点击连续采样数据?
- html - html/css:用括号括起来的输入元素的表格/网格