原创

IDE gradle 同步报错 IDE gradle 同步报错 Unable to find method ''org.gradle.api.tasks.TaskInputs org.gradle.api.tasks.TaskInputs.file

温馨提示:
本文最后更新于 2021年12月10日,已超过 858 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我

具体报错如下:

9:32 上午 Gradle sync failed: Unable to find method ''org.gradle.api.tasks.TaskInputs org.gradle.api.tasks.TaskInputs.file(java.lang.Object)''

'org.gradle.api.tasks.TaskInputs org.gradle.api.tasks.TaskInputs.file(java.lang.Object)'

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

Consult IDE log for more details (Help | Show Log) (8 s 302 ms)

解决方案:

工程build.gradle的配置:

dependencies {
    classpath 'com.android.tools.build:gradle:4.1.1'
    classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'

}

org.greenrobot:greendao-gradle-plugin  版本改为 3.3.0

app目录下的build.gradle 配置

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'org.greenrobot:greendao:3.2.2'
    implementation 'com.android.support:recyclerview-v7:26.0.0-alpha1'
    implementation 'com.jakewharton:butterknife:7.0.1'
    implementation 'com.android.support:support-v4:26.0.0-alpha1'
    implementation 'com.android.support:appcompat-v7:26.0.0-alpha1ƒ'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.3.0'
    implementation(name: 'frpclib', ext: 'aar')
//    compile 'cn.carbs.android:ExpandableTextView:1.0.0'
}

org.greenrobot:greendao 的版本改为 3.3.0

成功运行

正文到此结束
本文目录