Setting up Gradle for api 26 (Android)

后端 未结 6 884
青春惊慌失措
青春惊慌失措 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 16:02

    you must add in your MODULE-LEVEL build.gradle file with:

    //module-level build.gradle file
    repositories {
        maven {
            url 'https://maven.google.com'
    
        }
    }
    

    see: Google's Maven repository

    I have observed that when I use Android Studio 2.3.3 I MUST add repositories{maven{url 'https://maven.google.com'}} in MODULE-LEVEL build.gradle. In the case of Android Studio 3.0.0 there is no need for the addition in module-level build.gradle. It is enough the addition in project-level build.gradle which has been referred to in the other posts here, namely:

    //project-level build.gradle file
    allprojects {
     repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
      }
    }
    

    UPDATE 11-14-2017: The solution, that I present, was valid when I did the post. Since then, there have been various updates (even with respect to the site I refer to), and I do not know if now is valid. For one month I did my work depending on the solution above, until I upgraded to Android Studio 3.0.0

提交回复
热议问题