我正在尝试构建一个cordova应用。
但是当我尝试构建它时,出现以下错误消息:
Error:Cause: 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:
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
- 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.
我实际上是android开发的新手,我很迷路。
希望有人可以指导我解决这个问题。
最佳答案
如果您使用的是Android Studio,请从Android项目资源管理器中找到gradle-wrapper.properties,打开它,更改distributionUrl行,例如以下内容(2.14.1只是一个示例):
distributionUrl = https://services.gradle.org/distributions/gradle-2.14.1-all.zip
然后重新构建,这可以解决此问题。
关于android - Android Studio无法同步Gradle项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39337883/