我最近打开了一个旧项目,将Android Studio更新为3.1.3,现在无法运行该项目。这是我收到的消息:
Unable to find method 'com.google.common.collect.ImmutableSet.toImmutableSet()Ljava/util/stream/Collector;'.
Possible causes for this unexpected error include:
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.
在第二次尝试后,此消息随后出现:
Could not initialize class com.android.build.gradle.internal.ide.ModelBuilder
gradle项目同步一直失败,我在下面尝试了所有这些解决方案,包括无效/重新启动缓存,删除.gradle文件等。
我不是Android的向导,所以如果有人可以带领我朝正确的方向前进,将不胜感激!