google()和maven之间的区别{url'https://maven.google.com'} [英] Difference between google() and maven { url 'https://maven.google.com' }

查看:157
本文介绍了google()和maven之间的区别{url'https://maven.google.com'}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

google()和maven {url' https://maven.google.com 之间是否有任何区别在build.gradle文件中,如果有的话,它是什么?

Is there any difference between google() and maven { url 'https://maven.google.com' } in build.gradle file and if there is any, what is it?

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
        // OR
        google()
    }
}


推荐答案

google() repository是Google的maven存储库的快捷方式。它是在Gradle 4.x +中引入的。使用的实际存储库URL是 https://dl.google.com/dl/android/ maven2 / 指定此处。 https://maven.google.com 实际上指向同一个存储库。

The google() repository is a shortcut to Google's maven repository. It was introduced in Gradle 4.x+. The actual repository URL used is `"https://dl.google.com/dl/android/maven2/" as specified here. https://maven.google.com actually points to the same repository.

但是,如果您打算使用 google()快捷方式,则需要Gradle 4.x +,Android Studio适用于Android 3.x +的3.x +和Gradle插件。

However, if you are planning to use the google() shortcut, you need Gradle 4.x+, Android Studio 3.x+ and Gradle plugin for Android 3.x+.

这篇关于google()和maven之间的区别{url'https://maven.google.com'}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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