Error importing a Gradle Android project in Android Studio

Viewed 1909

This is a follow-up question here. I was initially trying to just install the .apk executable given by the Android project, but now I am trying to build the project myself, which is located at: https://github.com/garlicPasta/dotViewer

It is essentially supposed to receive a 3D graphics file (.ply format) from the server and visualize it.

The project is using Gradle, but when I'm trying to import it in Android Studio, I see the following message:

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.

I tried compiling it manually with gradle (installed gradle 2.10 to be compatible with the project). Can someone with more experience help me to import and run the project and find out what is missing for compiling?

BTW, there are two missing .java files which can be generated after compiling the .proto files.

2 Answers

I guess this is a problem gradle-2.14.1-all ,when I change the Gradle version to 3.3 ,then sync the project .This problem disappears。you can try it.

Related