在 Android Studio 中使用 jcenter 和 mavenCentral [英] Using jcenter and mavenCentral both in Android Studio

查看:59
本文介绍了在 Android Studio 中使用 jcenter 和 mavenCentral的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Android Studio 的新手.我在我的项目中使用库.maven central 已经更新了 facebook sdk 版本,而我正在使用的其他库在 jcenter 上可用.我想知道我们是否可以在我们的项目中同时使用这两个存储库.如果是,那么我如何需要在 gradle 文件中定义它,以便工作室从正确的位置下载 aar.任何示例都会有所帮助.

I am new to Android Studio. I am using libraries in my project. The maven central has updated version of facebook sdk, while rest of libraries I am using are available on jcenter. I want to know if we can use both these repositories in our project. If yes, then how do I need it to define in gradle file so that studio downloads aar from correct location. Any example would be helpful.

推荐答案

对于 maven,只需将其添加到您的 pom.xml 中:

and for maven just add to your pom.xml:

<repositories>
    <repository>
      <id>jcenter</id>
      <url>https://jcenter.bintray.com/</url>
    </repository>
</repositories>

这篇关于在 Android Studio 中使用 jcenter 和 mavenCentral的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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