Difference between google() and maven { url 'https://maven.google.com' }

Amit Kumar :

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()
    }
}
Jayson Chacko :

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.

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+.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=423876&siteId=1