不推荐使用配置'compile',但所有配置都是'implementation'

Val*_*hev 13 android gradle kotlin android-studio-3.0

我在android中执行gradle时收到以下警告:

Configuration 'compile' in project ':app' is deprecated.
Run Code Online (Sandbox Code Playgroud)

但是我的所有依赖项都包含在实现配置中.(还有模块)gradle中是否存在"隐形"依赖关系?

这是我的主要构建gradle文件:https://pastebin.com/ZJe7zrwn

Roh*_*rma 13

我今天在编译代码时找到了这个有用的解决方案.(当一切都在,你的一切都implementation没有)compilebuild.gradle

错误:

 1. Configuration 'compile' in project ':app' is deprecated 
 2. registerResGeneratingTask is deprecated, use registerGeneratedFolders (FileCollection)
Run Code Online (Sandbox Code Playgroud)

解:

我需要更新我的Project:build.gradle

classpath 'com.google.gms:google-services:3.1.0'
Run Code Online (Sandbox Code Playgroud)

classpath 'com.google.gms:google-services:3.2.0'
Run Code Online (Sandbox Code Playgroud)


Ale*_*nov 5

gradle 中是否有任何“不可见”的依赖项?

我不知道它是否对这个问题负责,但插件可以添加依赖项,特别com.google.gms.google-services

google-services 插件有两个主要功能:...

  1. 为您启用的服务所需的基本库添加依赖项。


Kis*_*nga 1

我认为您收到警告是因为您使用,

compileOnly "org.glassfish:javax.annotation:10.0-b28"
Run Code Online (Sandbox Code Playgroud)

这里给出了更好的解释,

Android Gradle 实现与 CompileOnly 性能对比

  • 不推荐使用compileOnly (4认同)