Android Studio - Failed to notify project evaluation listener error

前端 未结 30 1739
悲&欢浪女
悲&欢浪女 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条回答
  • 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
    
    0 讨论(0)
  • 2020-12-13 12:12

    The only thing that helped me was to use the system gradle instead of Android Studio's built-in:

    SETTINGS -> Build, Execution, Deployment -> Gradle

    Select Use local gradle distribution. To find the path, you can do which gradle where the which program is supported. It might be /usr/bin/gradle.

    See also Error:Could not initialize class com.android.sdklib.repositoryv2.AndroidSdkHandler for another possible cause.

    0 讨论(0)
  • 2020-12-13 12:12

    First Step:File → Settings → Build, Execution, Deployment → Instant Run and uncheck Enable Instant Run. Second step: Press Invalidate/Restart. done.... Enjoy.

    0 讨论(0)
  • 2020-12-13 12:13

    I am facing same error before a week I solve by disabling the Instant Run

    File → Settings → Build, Execution, Deployment → Instant Run and uncheck Enable Instant Run.

    Hope it works.

    Note This answer works on below Android Studio 3

    0 讨论(0)
  • 2020-12-13 12:13

    The problem is probably you're using a Gradle version rather than 3. go to gradle/wrapper/gradle-wrapper.properties and change the last line to this:

    distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
    
    0 讨论(0)
  • 2020-12-13 12:13

    I had this issue because I was using Charles proxy on my computer and the SSL was enabled for all hosts. And since AS didn't trust my proxy, the network request failed. So I had to disable SSL for all hosts and restart my Android Studio.

    0 讨论(0)
提交回复
热议问题