Setting up Gradle for api 26 (Android)

后端 未结 6 904
青春惊慌失措
青春惊慌失措 2020-12-04 15:13

Since I have upgraded my Nexus 5x to Android O DP3 I am not able to test my applications. I get the error for not having configured my Gradle-file to work with the new API-l

6条回答
  •  抹茶落季
    2020-12-04 15:56

    Have you added the google maven endpoint?

    Important: The support libraries are now available through Google's Maven repository. You do not need to download the support repository from the SDK Manager. For more information, see Support Library Setup.

    Add the endpoint to your build.gradle file:

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

    Which can be replaced by the shortcut google() since Android Gradle v3:

    allprojects {
        repositories {
            jcenter()
            google()
        }
    }
    

    If you already have any maven url inside repositories, you can add the reference after them, i.e.:

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

提交回复
热议问题