This problem occurs when there are multiple JDKs installed in your system, I had the same issue as I had mistakenly installed oracle-jdk-9 and Android studio requires oracle-jdk-8
If you are using Ubuntu you can install jdk-8 from this question.
So, Make following changes as shown below:
Press ctrl+shift+alt+s that will open project structure which can also be opened from
File -> Project Structure
And then change JDK Location where you may have installed JDK 8
Related Contents:
- Execution Failed for task :app:compileDebugJavaWithJavac in Android Studio
- Android Studio 3.1.3 Gradle Sync Error. Could Not Download Gradle-Core.jar
- Ionic build Android error when downloading Gradle
- UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define
- Import Google Play Services library in Android Studio
- Manifest merger failed error
- Failed to import new Gradle project: failed to find Build Tools revision *.0.0
- Gradle – What is a non-zero exit value and how do I fix it?
- :app:dexDebug ExecException finished with non-zero exit value 2
- Android studio – Failed to find target android-18
- Android studio – Failed to complete gradle execution – error in opening zip file
- Gradle sync failed: Unable to find method
- Android Studio Build gradle OutOfMemoryError
- How to redirect multiple types of users to their respective Activities?
- com.android.build.transform.api.TransformException
- Android Studio gradle takes too long to build
- How to make a .jar out from an Android Studio project
- Multi-project test dependencies with gradle
- Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci
- Error:Execution failed for task ‘:app:dexDebug’. com.android.ide.common.process.ProcessException
- How can I convert a part of Java source file to Kotlin?
- This app is not authorized to use Firebase Authentication.Please verify that the correct package name and SHA-1 are configured in the Firebase Console
- Android Studio Error: Error:CreateProcess error=216, This version of %1 is not compatible with the version of Windows you’re running
- Compilation failed to complete:Program type already present: com.google.android.gms.internal.measurement.zzabn
- javax.* cannot be imported in my Android app?
- Transitive dependencies not resolved for aar library using gradle
- cannot resolve symbol ‘java.time.LocalDate’ error in android studio
- Android Studio – No JVM Installation found
- How to download older google play services?
- Android: Dex cannot parse version 52 byte code
- How to write NDEF records to NFC tag?
- ‘:app:lintVitalRelease’ error when generating signed apk
- How to specify the JDK version in Android Studio?
- Error: Unable to run mksdcard SDK tool
- Android Studio Convert ISO string to “America/New_York” when adding to event to calendar
- Android Studio was unable to find a valid Jvm (Related to MAC OS)
- Exporting and running Unity3D project to Android Studio
- Android Studio cannot resolve symbol but code executes correctly
- JCenter deprecation; impact on Gradle and Android
- Android Studio TransformException : Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’
- Error:Execution failed for task ‘:app:processDebugResources’. > java.io.IOException: Could not delete folder “” in android studio
- How can I add a linked source folder in Android Studio?
- What does transitive = true in Gradle exactly do (w.r.t. crashlytics)?
- “Hello world” Android app with as few files as possible, no IDE, and text editor only
- == and .equals() not working in java [duplicate]
- How to print to the console in Android Studio?
- Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation
- Bumblebee Android studio Plugin [id: ‘com.android.application’, version: ‘7.1.0’, apply: false] was not found in any of the following sources:
- How to combine one android studio project into another android studio project
- tools.jar seems to be not in Android Studio classpath on Windows 8