1

After I have installed Android Studio 2.2.2 version. when i create new project and run means, gradle not sync. I am getting this following error.

Gradle 'MyAptest' project refresh failed
Error:Cause: java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at java.util.Arrays$ArrayList.<init>(Arrays.java:3813)
at java.util.Arrays.asList(Arrays.java:3800)
at    com.intellij.openapi.util.io.FileUtilRt.doCreateTempFile(FileUtilRt.java:399)
at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:361)
Abhishek Aryan
  • 19,936
  • 8
  • 46
  • 65
harikrishnan
  • 1,985
  • 4
  • 32
  • 63

1 Answers1

0

Try a few of the following:

  • File -> Invalidate Caches / Restart -> Invalidate and Restart
  • Check the Gradle home path to ensure it is valid
  • Re-import the project into android studio
apmartin1991
  • 3,064
  • 1
  • 23
  • 44
  • thank you apmartin. i have tried method http://stackoverflow.com/questions/19874743/gradle-project-refresh-failed-after-android-studio-update. i have deleted lib gradles files from this location.C:\Program Files\Android\Android Studio\plugins\gradle\lib.. then, all sdk,gradles icons are gone now.but, i have backup for that lib folder files. shall i replace there again – harikrishnan Nov 23 '16 at 10:26
  • No worries. What Gradle version & Android Plugin version are you using? You can find this in the project structure of your project. – apmartin1991 Nov 23 '16 at 10:29
  • C:\Program Files\Android\Android Studio\gradle\gradle-2.14.1 & classpath 'com.android.tools.build:gradle:2.2.2' – harikrishnan Nov 23 '16 at 10:32
  • also, i replaced that lib folder gradle files to original location. – harikrishnan Nov 23 '16 at 10:33