gpt4 book ai didi

android - Gradle 找不到方法 compile() - v28?

转载 作者:行者123 更新时间:2023-11-29 16:38:06 26 4
gpt4 key购买 nike

我在同步 Gradle 时遇到错误:

Could not find method compile() for arguments [com.android.support:support-core-utils:28.0.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Please install the Android Support Repository from the Android SDK Manager.

我已经找到了以前版本的解决方案,但我一直在为 v28 开发,我什至不确定我的 compile "com.android.support:support-core-utils:28.0.0" 行是正确的。这是一个 firebase 聊天应用程序,我正在学习 2016 年的教程。我最终从经理那里安装了支持,但出现了同样的错误。

最佳答案

在 Gradle 4.4 版本中,您不能使用 compile,而是使用 implementation 方法减少它

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
testImplementation 'junit:junit:4.12'

关于android - Gradle 找不到方法 compile() - v28?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52053902/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com