简体   繁体   English

gradlew app:依赖关系到底是什么?

[英]What exactly does gradlew app:dependencies do?

An app of mine was crashing on Android 4.4.4 giving the following runtime exception: 我的应用程序在Android 4.4.4上崩溃,给出以下运行时异常:

android.view.InflateException: Binary XML file line #26: Error inflating class android.support.design.widget.TextInputLayout

My gradle file showed the following lint error: 我的gradle文件显示以下lint错误:

All com.android.support libraries must use the exact same version... 所有com.android.support库必须使用完全相同的版本...

I read something on stack that made be type this into the terminal: 我在堆栈上读到的东西是在终端中输入的:

gradlew app:dependencies gradlew app:依赖项

It listed all my library/project dependencies. 它列出了我所有的库/项目依赖项。 It also has this in some areas: 它在某些方面也有这个:

     +--- com.jakewharton:butterknife:8.4.0
|    +--- com.jakewharton:butterknife-annotations:8.4.0 (*)
|    \--- com.android.support:support-annotations:24.1.0 -> 25.1.0

The above looks like it's updating the libraries I've added to the latest support library versions. 以上看起来它正在更新我添加到最新支持库版本的库。

Anyway, after using the above command and rebuilding the project, the app started to work even though I still see the lint error regarding different support library versions. 无论如何,在使用上述命令并重建项目后,应用程序开始工作,即使我仍然看到有关不同支持库版本的lint错误。

What exactly does gradlew app:dependencies do? gradlew app:依赖关系到底是什么? And did it fix the error I was getting? 它修复了我得到的错误吗?

dependencies - Displays all dependencies declared in root project 'projectReports'. dependencies - 显示在根项目'projectReports'中声明的所有依赖项。

So it's quite clear what it does. 所以很清楚它的作用。 So why it fixed problem? 那为什么它解决了问题呢? I don't think it was fixed because of app:dependencies was executed, mostly I think it was fixed due fact that you've rebuilt project. 我不认为它是因为app:dependencies而被修复app:dependencies被执行了,大多数情况下我认为它是固定的,因为你重建了项目。 Sometimes, probably due bug in build system (or more often because of instant run "feature"), you can end up with inconsistent apk file. 有时,可能是由于构建系统中的错误(或者更常见的是因为即时运行“功能”),最终可能会出现不一致的apk文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM