Error:org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to

  • Error:org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to
Error:org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection
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.

这个是打开Android Studio项目报的错误提示,单纯从上面的提示仍是不能太直接的知道什么问题。后来我想这个项目的Gradle版本与我当前AS使用的版本不一致,多是这个问题。因而我把项目的版本改为与AS一致再同步一下,果真就行了。android

classpath 'com.android.tools.build:gradle:2.1.0'

改为web

classpath 'com.android.tools.build:gradle:2.3.1'

注意这个版本号是随AS的版本号走的,好比我当前使用的是2.3.1版本。api

  • Error:The SDK Build Tools revision (23.0.3) is too low for project ‘New Unity Project’. Minimum required is 25.0.0
Error:The SDK Build Tools revision (23.0.3) is too low for project 'New Unity Project'. Minimum required is 25.0.0
<a href="fix.build.tools.version">Update Build Tools version and sync project</a><br><a href="openFile:D:/Xanthuim/Unity/New Unity Project/AS/New Unity Project/build.gradle">Open File</a>

这个错误提示就比较明显了,说你当前项目使用的SDK版本过低了,须要改为25.0.0。改完以后再同步一下就能够了。bash