How can I determine what dependencies I need in the gradle build file for my Android project

那年仲夏 提交于 2020-01-03 01:40:13

问题


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

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?


回答1:


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

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

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.

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




回答2:


You can check for official documentation or check this link: https://material.io/develop/android/

If you are not using androidx then add this library

implementation "com.android.support:design:27.1.1"

else you can use this:

implementation "com.google.android.material:material:1.1.0-alpha05"




回答3:


Few ways to update to the dependency version you need or how to include one -

  1. (Only for IntelliJ platforms) Go to the gradel (app) there you'll see yellow ballons and marked lines which will automatically ask you to update it on mouse hover. For which click the balloon to see further options

Image for an older version

  1. Check for official documentations from Google

https://developer.android.com/guide



来源:https://stackoverflow.com/questions/56521665/how-can-i-determine-what-dependencies-i-need-in-the-gradle-build-file-for-my-and

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!