Error:Unable to find method 'org.gradle.api.tasks.TaskInputs.file(Ljava/lang/Object;)Lorg/gradle/api/tasks/TaskInputFilePropertyBuilder;'.
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
<a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li><li>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.</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
greendao3.2.3配置时遇到的问题
这两天我一直在研究greendao这个框架,我在GitHub下载了
greendao3.2.2:https://github.com/greenrobot/greenDAO,照着网址里面来配置:
// In your root build.gradle file: buildscript { repositories { jcenter() mavenCentral() // add repository } dependencies { classpath 'com.android.tools.build:gradle:2.3.1' classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin } } // In your app projects build.gradle file: apply plugin: 'com.android.application' apply plugin: 'org.greenrobot.greendao' // apply plugin dependencies { compile 'org.greenrobot:greendao:3.2.2' // add library }
后来发现配置后并不能创建项目并报了如下错误:
Error:Unable to find method 'org.gradle.api.tasks.TaskInputs.file(Ljava/lang/Object;)Lorg/gradle/api/tasks/TaskInputFile......
我去网上找了很久都没有找到解决办法,又迷迷糊糊冲撞了一整天...
后来我仔细看了一下报错,感觉问题出现在了gradle版本上而不是Android studio上,我之前用的gradle版本是
gradle-2.14.1-all,和Android studio2.2.2版本
解决问题:
后来我在官网:https://services.gradle.org/distributions/中下载了gradle-3.5-all版本并且在Android studio
中file->settings->build,execution,deployment->Gradie
点击OK 就成功解决掉了问题
希望这个配置问题解决方法对你们有用
越努力 越幸运
转自:
http://www.cnblogs.com/wangxiankai/p/6707725.html