在我的项目构建中,我已经替换了每一个compile by implementation的出现。gradle,但是我仍然得到这个警告:
我试图在整个项目中寻找“compile”,但没有找到匹配。那么原因是什么呢?
在我的项目构建中,我已经替换了每一个compile by implementation的出现。gradle,但是我仍然得到这个警告:
我试图在整个项目中寻找“compile”,但没有找到匹配。那么原因是什么呢?
当前回答
我有一个相同的警告导致com.google.gms:google-services。
解决方案是升级classpath com.google。Gms:google-services到类路径'com.google.gms:google-services:3.2.0'在文件中构建。gradle项目:
buildscript {
repositories {
jcenter()
google()
}
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'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
在Android Studio 3.1版本中,依赖项compliword被替换为 实现
在android studio 3.1中依赖Warning
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
在android studio 3.1中确定依赖
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
graddel生成的Android Studio 3.1的新项目。
访问https://docs.gradle.org/current/userguide/dependency_management_for_java_projects.html
详情https://docs.gradle.org/current/userguide/declaring_dependencies.html
其他回答
回复谷歌:https://issuetracker.google.com/issues/74048134
会有一些依赖仍然使用编译,仔细检查你的应用程序依赖和传递依赖。
回到你的位置。在项目级别的Gradle文件中,您会发现以下行突出显示
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4' //place your cursor over here
//and hit alt+enter and it will show you the appropriate version to select
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.0.2' //the same as previously
}
仅仅更新谷歌服务版本对我来说不起作用。
首先,确保所有的依赖编译都替换为实现。 更新项目中的所有依赖项。因为如果你的一个依赖项正在编译,那么你的项目就会显示这个错误。所以更新所有依赖项版本。
不需要拆线。正如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'