Created a new project, got the following in the console:

Gradle 'HelloWorld' project refresh failed Error:Process 'command '/usr/lib/android-studio/jre/bin/java'' finished with non-zero exit value 2 

In Google, I saw that the problem could be with java. Checked:

 java -version java version "1.8.0_111" Java(TM) SE Runtime Environment (build 1.8.0_111-b14) Java HotSpot(TM) Server VM (build 25.111-b14, mixed mode) 

System-Ubuntu 16.04. What could be the problem?

  • one
    In your project settings, is the path to jdk correctly set? - Suvitruf
  • Picked up in Google also found a mention about the path to jdk. I put the JAVA_HOME variable and the problem was solved (ide picked it up when I started it and registered the path to jdk from java 8). There are no errors, but another incident came out. Created empty activit, there in the MainActivity code there is a line setContentView (R.layout.activity_main); At R. he swears and says that Cannot resolve sybol 'R' - Iga
  • one
    R - autogenerate. If you swear at it, it means that there are some other errors in the project that do not allow it to be generated. - Suvitruf
  • 2
    Try downgrading Gradl to this dl.google.com/android/repository/build-tools_r23.0.3-linux.zip - Suvitruf
  • one
    Well, that is downgrade. - Suvitruf

1 answer 1

The question was solved by replacing the buildToolsVersion parameter from version "25.0.0" to "23.0.1" in the build.gradle file. The problem was that the bit width of my current system is 32 bits. This bit width supports the maximum version sdk = 23