Android Studio - Failed to notify project evaluation listener error

前端 未结 30 1867
悲&欢浪女
悲&欢浪女 2020-12-13 11:45

Following is the build.gradle code in Android Studio

apply plugin: \'com.android.application\'

android {
    compileSdkVersion 23
    buildToolsVersion \"23         


        
30条回答
  •  Happy的楠姐
    2020-12-13 12:12

    I also encountered this error when updating to 'com.android.tools.build:gradle:3.0.0'

    To fix it, I had to add the google() repo to both the buildscript and module repositories. The documentation here only mentions adding to to the buildscript.

    Project-level build.gradle

    buildscript {
        repositories {
            ...
            // You need to add the following repository to download the
            // new plugin.
            google()
        }
    
        dependencies {
            classpath 'com.android.tools.build:gradle:3.0.0'
        }
    }
    

    App-level build.gradle

    repositories {
        ...
        // Documentation doesn't specify this, but it must be added here
        google()
    }
    

    gradle-wrapper.properties

    ...
    distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
    

提交回复
热议问题