[英]Android Studio: make application depending on sources of third-party library
I got in troubles when trying to put dependncies on my project on third-party library. 尝试对第三方库上的项目施加依赖时遇到麻烦。 I tried to depend on the same lib from maven, but version in maven is not up-to-date, however downloaded package has latest changes. 我试图依赖于来自maven的同一个库,但是maven中的版本不是最新的,但是下载的软件包具有最新更改。
Downloaded folder has only 'src', 'pom' and '.gitignore' in it. 下载的文件夹中仅包含“ src”,“ pom”和“ .gitignore”。 When I try to import project into Android Studio and then put dependencies, I can't because Android Studio only wants Gradle or Eclipse project to be imported. 当我尝试将项目导入Android Studio并放入依赖项时,我不能这样做,因为Android Studio只希望导入Gradle或Eclipse项目。 I tried to create at least IntelliJ project from existing sources, however after I still cannot set dependencies as Android Studio requires just Gradle or Eclipse project. 我尝试至少从现有资源创建IntelliJ项目,但是在我仍然无法设置依赖项之后,因为Android Studio仅需要Gradle或Eclipse项目。 Can you help me with that dependencies issue? 您可以帮我解决相关性问题吗? Thanks. 谢谢。
Three options here: 这里有三个选择:
mvn install
. 作为最后的选择,您可以运行mvn install
,检查源代码,并使用Maven进行构建(必须安装Maven并将其包含在路径中)。 After you done that (assuming the project is built successfully), you can put the jar from the build
folder into your lib
folder, or add maven
plugin to your build.gradle
that will find the jar file automatically in your local machine cache. 完成此操作后(假设项目已成功构建),可以将jar文件从build
文件夹放到lib
文件夹中,或将maven
插件添加到build.gradle
,该插件将在本地计算机缓存中自动找到jar文件。 In any of the later two cases, you're more than welcome to ask the developer to publish its project binaries to Bintray. 在后两种情况中的任何一种情况下,都非常欢迎您要求开发人员将其项目二进制文件发布到Bintray。 That will allow the right usage (#1) to all the rest of the users. 这将允许所有其他用户正确使用(#1)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.