在我的项目构建中,我已经替换了每一个compile by implementation的出现。gradle,但是我仍然得到这个警告:

我试图在整个项目中寻找“compile”,但没有找到匹配。那么原因是什么呢?


当前回答

希望build.gradle(app)对你有影响 如果是这样,请执行此步骤

在build.gradle中将compile替换为androidtestimplemimplementation

androidTestImplementation 'com.android.support:appcompat-v7:27.1.1'
androidTestImplementation 'com.android.support:design:27.1.1'

如此简单!希望这能解决

其他回答

谷歌于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'

回复谷歌:https://issuetracker.google.com/issues/74048134

会有一些依赖仍然使用编译,仔细检查你的应用程序依赖和传递依赖。

https://issuetracker.google.com/issues/72479188表示插件有时会引入“编译”依赖项,这就是触发警告的原因。可能只是最简单的星号问题,并等待,直到他们修复它,指出哪些插件导致的问题。

打开构建。Gradle文件位于这里:

这是编写依赖库的旧方法(对于gradle版本2及以下):

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile files('libs/volley.jar')
    compile 'com.android.support:support-v4:21.+'
}

这是导入gradle版本3依赖项的新方法(正确的):

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    testImplementation 'junit:junit:4.12'
    implementation files('libs/volley.jar')
    implementation 'com.android.support:support-v4:21.+'
}

不需要拆线。正如Jkrevis所写的,更新com.google。Gms:google-services升级到3.2.0并停止警告。