简体   繁体   English

当我从 Maven 向项目添加 lib 时。 如何找出我可以使用的课程?

[英]When I add a lib to a project from maven. How do I find out classes I can use?

Documentation of said library says to import a specific class, and different one for older versions.所述库的文档说要导入一个特定的类,而对于旧版本则要导入不同的类。

I tried both and none are recognized by android studio as exisiting.我尝试了两者,但没有一个被 android studio 识别为存在。

How do I find out if an mavenCentral() library has been downloaded and included to my android project??如何确定 mavenCentral() 库是否已下载并包含在我的 android 项目中?

How do I find out if an mavenCentral() library has been downloaded and included to my android project?如何确定 mavenCentral() 库是否已下载并包含在我的 android 项目中?

If you added the appropriate line to your module's Gradle build script (eg, implementation ... ), it should be there, or you would have gotten a build error complaining about not being able to download the artifact.如果您在模块的 Gradle 构建脚本中添加了适当的行(例如, implementation ... ),它应该在那里,否则您会收到构建错误,抱怨无法下载工件。

You can see what libraries are available to your overall project in Android Studio by first switching the project tree from the Android view to the Project view via the drop-down above the tree:首先通过树上方的下拉菜单将项目树从 Android 视图切换到项目视图,您可以在 Android Studio 中查看哪些库可用于整个项目:

Android Studio 项目树,显示下拉列表

Android Studio 项目树,显示项目视图

If you scroll down in the tree, you will find a "External Libraries" branch of the tree that you can expand:如果您在树中向下滚动,您将找到可以展开的树的“外部库”分支:

Android Studio 项目树,显示外部库

This lists all of the libraries available to the whole project, including those from tests, transitive dependencies, etc.这列出了整个项目可用的所有库,包括来自测试、传递依赖等的库。

暂无
暂无

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

相关问题 我使用从maven生成的jar通过install4j为我的app创建了一个安装程序。 为什么在执行.exe时找不到主类? - I created an installer via install4j for my app using a jar generated from maven. Why can't it find the main class when executing the .exe? 如何使用maven的其他项目中的类? (抛出ClassNotFoundException和NoClassDefFoundError) - How can I use classes from other project with maven? (ClassNotFoundException and NoClassDefFoundError is thrown) 如何从 maven 的本地存储库中找出我可以使用哪些依赖项? - How to find out what kind of dependencies I can use from local repository in maven? 如何在这个java项目中使用maven - How do I use maven with this java project 我如何在 IntelliJ IDEA 中使用来自另一个项目的类? - How do I use classes from another project in IntelliJ IDEA? 如何将Maven项目用作另一个Maven项目的依赖项? - How can I use a Maven project as a dependency to another Maven project? 在netbeans 7中,如何在构建maven项目时跳过测试并添加maven附加参数? - In netbeans 7 how do I skip testing and add maven additional parameters when building a maven project? 如果我想使用 autoit 如何在 maven 项目中使用 - If I want to use autoit how can I use in maven project 当我想使用 MAVEN 安装我的项目时,如何添加包日期时间? - How can I add a package date time when I want to install my project using MAVEN? 在 Eclipse 中导出 java 项目时如何清除旧类? - How do I clear out old classes when exporting a java project in Eclipse?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM