Android Studio - Failed to notify project evaluation listener error

前端 未结 30 1740
悲&欢浪女
悲&欢浪女 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:15

    In my case I solved this error only by Invalidating caches.

    File > Invalidate caches / Restart

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

    For those of you working on a team:

    I pulled down some changes that included updating the build tools version, but I had not downloaded that new version of the build tools on my machine. Downloading the new version fixed this issue for me

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

    I ignored using JDK13 with Android Studio, So I selected below settings and it was solved:

    Step 1. (File > Other Settings > Default Project Structure > SDK Location > JDK Location)

    Embedded JDK 
    

    Step 2. (File > Project Structure > Project)

    gradle plugin 3.6.3 
    
    gradle 5.6.4 
    
    0 讨论(0)
  • 2020-12-13 12:19

    Usually it depends on Instant run or Gradle, but I tried both variants and nothing helped me. Then I looked through idea.log and saw this error

    Caused by: java.lang.RuntimeException: A conflict was found between the 
    following modules:
     - com.android.support:support-core-utils:25.3.1
     - com.android.support:support-core-utils:27.0.1
    

    I really don't know why this error is not shown in Gradle Console or Event Log tab. Then I fixed it by adding some code to the end of android{} block.

    configurations.all {
        resolutionStrategy {
            failOnVersionConflict()
            eachDependency { DependencyResolveDetails details ->
                if (details.requested.name == 'support-core-utils') {
                    details.useVersion '25.3.1'//Or you can use 27.0.1 if it does not conflict with your other dependencies
                }
        }
    }
    
    0 讨论(0)
  • 2020-12-13 12:20

    This is neither an exact answer to the question nor a silver bullet. However, if nothing works for you e.g. Invalidate cache & restart, Checking build dependency, Disabling Instant Run (I never advise that) etc.

    1. Add command-line option --stacktrace in Setting > Build, Execution, Deployment > Compiler
    2. Now build/assemble gradle once again. You will have detailed information about the cause. e.g. in my case:

    Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.squareup.okhttp3:logging-interceptor:3.9.1Net.

    I have misspelled the dependency name in module level gradle file. Hope that help

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

    In my case I had to update all the Firebase libraries to the latest versions.

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