gpt4 book ai didi

android - 我应该在 Android Studio 的 Gradle 中将一些依赖项移动到 `runtime` 吗?

转载 作者:太空宇宙 更新时间:2023-11-03 10:38:02 24 4
gpt4 key购买 nike

使用 gradle-lint-plugin在 Android Studio 中,它提示

:lintGradle

This project contains lint violations. A complete listing of the
violations follows. Because none were serious, the build's overall
status was unaffected.

this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:43 compile 'com.android.support:appcompat-v7:24.1.0'

this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:44 compile 'com.android.support:design:24.1.0'

this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:45 compile 'com.android.support:cardview-v7:24.1.0'

this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:52 compile
'com.github.gigamole.arcprogressstackview:library:+'

this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:53 compile 'com.github.dexafree:materiallist:3.2.1'

this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:54 compile 'com.android.volley:volley:1.0.0'

this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:55 compile 'com.cocosw:bottomsheet:1.+@aar'

this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:57 compile 'com.android.support:support-v4:+'

this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:58 compile 'com.github.shem8:material-login:1.4.0'

this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:64
compile('com.github.ozodrukh:CircularReveal:1.3.1@aar') {
transitive = true; }

this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:74 compile 'com.github.rey5137:material:1.2.4'

? app/build.gradle: 11 problems (0 errors, 11 warnings)

To apply fixes automatically, run fixGradleLint, review, and commit
the changes.


BUILD SUCCESSFUL

我应该听取建议吗?如果这些依赖项应该在runtime 中,为什么每个依赖项 wiki/doc 都不这么说,而是坚持告诉我们将依赖项放在 compile 中?

编辑:我尝试采纳建议,换句话说,将关键字 compile 更改为 runtime,例如 runtime 'com.android.support:appcompat -v7:24.1.0'。但是,Android Studio 提示

Error:Could not find method runtime() for arguments
[com.android.support:appcompat-v7:24.1.0] on object of type
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Please install the Android Support Repository from the Android SDK
Manager. <a href="openAndroidSdkManager">Open Android SDK Manager</a>

那么问题是什么?

最佳答案

我相信 apkruntime 的 android,例如:

apk 'com.android.support:appcompat-v7:24.1.0'

有人说package

https://stackoverflow.com/a/28473873/360211

也许两者都有效,也许没有区别,也许有区别。我不知道非常无法搜索的术语。

关于android - 我应该在 Android Studio 的 Gradle 中将一些依赖项移动到 `runtime` 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39614745/

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