如何确定我的Android项目的gradle构建文件中需要哪些依赖项 [英] How can I determine what dependencies I need in the gradle build file for my Android project

查看:171
本文介绍了如何确定我的Android项目的gradle构建文件中需要哪些依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,Android Studio已处理了此问题,但并非万无一失。

So far Android studio has handled this, but it is not infallible.

给出目标构建版本(27)的信息以及我需要的组件(TabViews与片段,但无需刷卡),在哪里可以找到确定模块build.gradle依赖项所需的信息?

Given the information of target build version (27) and which components I require (TabViews with Fragments, but no need for swiping), where can I find the information required to determine what goes in the module build.gradle dependencies?

推荐答案

这可能不是解决方案,但会有所帮助。这是列出这些库的两个链接。

This might not be the solution, but a little help. Here are two links that list the libraries.

Android支持库: https://developer.android.com/topic/libraries/support-library/packages

Android Support libraries: https://developer.android.com/topic/libraries/support-library/packages

Android X库: https://developer.android.com/jetpack/androidx/migrate

Android X libraries: https://developer.android.com/jetpack/androidx/migrate

因此,如果由于缺少类而导致构建失败,则可以在此处进行检查并添加合适的依赖项。

So if you build fails because of missing classes, you can check here and add the fitting dependency.

也请注意,Android Studio可让您自动迁移到Android X(重构>迁移到AndroidX)。

Also note that Android Studio lets you auto-migrate to Android X (Refactor > Migrate to AndroidX).

这篇关于如何确定我的Android项目的gradle构建文件中需要哪些依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆