IDE gradle 同步报错 IDE gradle 同步报错 Unable to find method ''org.grad

举报
仙士可 发表于 2023/06/26 17:06:27 2023/06/26
【摘要】 具体报错如下: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.ta...

具体报错如下:

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 

成功运行

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。