Android Studio Gradle Error at Compile Time

后端 未结 7 1032
既然无缘
既然无缘 2020-12-14 16:39

I have an Android App in Android Studio. When I build project with Gradle File,it gives me one error at compile time. Error Report:

Error:org.gradle.api.inte         


        
相关标签:
7条回答
  • 2020-12-14 16:58

    If you using GreenDao You should update it to the lastest version

    classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0' // add plugin
    implementation 'org.greenrobot:greendao:3.3.0'
    
    0 讨论(0)
  • 2020-12-14 17:00

    Easy solution! Just fixed on my side. It was a project exported from Unity Studio.

    After exporting from Unity, the gradle was like com.android.tools.build:gradle:2.1.0

    I then changed it to com.android.tools.build:gradle:2.2.0 and it worked.

    Also never forget to change the repositories from mavencenteral to jcenter().

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.3.3'
        }
    }
    
    0 讨论(0)
  • 2020-12-14 17:02

    1.delete {project dir}/.gradle/{gradle distribution version dir}

    {gradle distribution version dir} is whatever the gradle distribution version you use (ref: https://developer.android.com/studio/releases/gradle-plugin.html#revisions). For example, it can be "1.9" or "2.10" or some other version number.

    2.Sync Project with Gradle File

    0 讨论(0)
  • 2020-12-14 17:07

    For me, I have tried to:

    (Doesn't Work):

    1. invalidate caches.

    2. stop third-party plugins.

    3. remove gradle repository.

    4. remove {project dir}/.gradle/2.*(which are not current gradle version)

    (Work):

    Finally, the answer is like @MAC113's,

    delete {project dir}/.gradle/2.10 (2.10 is my current gradle version)

    0 讨论(0)
  • 2020-12-14 17:07

    None of those solutions working for me. I ended up by:

    • Clone my project to a new folder
    • Remove .gradle, .idea folders
    • Add as a new project (File > Open > [new folder])

    It works! It's a weird issue that I've ever met.

    0 讨论(0)
  • 2020-12-14 17:09

    This is what worked for me:

    Android Studio -> File -> Invalidate Caches and Restart

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