构建Github Android项目时遇到的问题

构建Github Android项目时遇到的问题

这是一个后续问题这里。我最初只是尝试安装.apk可执行文件,但现在我尝试构建位于以下位置的项目:https://github.com/garlicPasta/dotViewer

它本质上应该.ply从服务器接收 3D 图形文件(格式)并将其可视化。

该项目正在使用 Gradle,但是当我尝试将其导入 Android Studio 时,看到以下消息:

Error:Unable to find method 'com.android.build.gradle.tasks.factory.AndroidJavaCompile.setDependencyCacheDir(Ljava/io/File;)V'.
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.

有经验的人能帮助我导入和运行该项目并找出编译中缺少的内容吗?

更新:缺少两个 .java文件,编译文件后可以生成这两个文件.proto

答案1

从文件生成 java 文件后.proto,项目可以通过命令行完美编译gradlew。对于 Android Studio,我只需将该项目作为新项目导入,就不会再出现错误。

相关内容