在我的项目构建中,我已经替换了每一个compile by implementation的出现。gradle,但是我仍然得到这个警告:
我试图在整个项目中寻找“compile”,但没有找到匹配。那么原因是什么呢?
在我的项目构建中,我已经替换了每一个compile by implementation的出现。gradle,但是我仍然得到这个警告:
我试图在整个项目中寻找“compile”,但没有找到匹配。那么原因是什么呢?
当前回答
我已经尝试在Android Studio 3.0.1中将谷歌gms服务更改为最新的com.google.gms:google-services:3.2.1,但警告仍然存在。
根据编译器的建议,我将所有编译依赖项更改为实现,并将testCompile更改为testimplemimplementation,如下所示。
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:mediarouter-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.firebase:firebase-ads:12.0.1'
implementation 'com.google.firebase:firebase-crash:12.0.1'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-messaging:12.0.1'
implementation 'com.google.firebase:firebase-perf:12.0.1'
implementation 'com.google.firebase:firebase-appindexing:12.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
最后,警告被删除!
其他回答
去你的建筑。Gradle(应用级)
构建。Gradle模块app
将“编译”替换为“实现”
100%可以正常工作
不需要拆线。正如Jkrevis所写的,更新com.google。Gms:google-services升级到3.2.0并停止警告。
谷歌于2021年9月更新了其服务。给更新,我面临同样的问题,然后我更新构建。android studio中的Gradle文件
旧版本有问题
classpath 'com.google.gms:google-services:4.3.3'
更新了build.gradle中的代码
classpath 'com.google.gms:google-services:4.3.10'
我已经更新了com.google。Gms:google-services从3.1.1升级到3.2.0,警告停止出现。
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.1.0")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath("com.google.gms:google-services:3.2.0")
}
}
你有两种选择:
在project: build中添加类路径'com.google.gms:google-services:3.2.0'。gradle依赖性 而且 替换模块:build。Gradle依赖于编译实现 而且你不会收到任何警告信息。