This occur due to incompatible java version you are using in android studio and the java version that was used with your imported project.
Go to
File->Project structure->Change jdk 1.7 to jdk 1.8 .After that Go to File->click on Invalidate cache and Restart.
Hope this help..
And change the dependency classpath in gradle file
I tried to find solution to this problem.I tried most of the solutions mentioned in this thread. However, I am not very sure why this was occurring. Probably a bug in Android Studio. Anyhow, this is what solved the problem:
Make sure to do a clean build after changing a version of Java. As it turns out Android Studio does some work when you switch the JDK but doesn't clean the workspace and creates confusion ¯\_(ツ)_/¯
This occur due to incompatible java version you are using in android studio and the java version that was used with your imported project. Go to File->Project structure->Change jdk 1.7 to jdk 1.8 .After that Go to File->click on Invalidate cache and Restart. Hope this help..
And change the dependency classpath in gradle file
dependencies { classpath 'com.android.tools.build:gradle:2.2.3'
1、make sure Gradle Gradle JVM Version
2、make sure ProjectSettings SDKs Veriosn
I tried to find solution to this problem.I tried most of the solutions mentioned in this thread. However, I am not very sure why this was occurring. Probably a bug in Android Studio. Anyhow, this is what solved the problem:
In Application level build.gradle, removed:
replaced with:
I had to update Java version to JDK 8 at Jenkins->Manage Jenkins->Global Tool Configuration->JDK.
Check your
JAVA_HOME
to use jdk 1.8Also check : the parameter in Android Studio in order to change at
Make sure to do a clean build after changing a version of Java. As it turns out Android Studio does some work when you switch the JDK but doesn't clean the workspace and creates confusion
¯\_(ツ)_/¯