Android Studio 2.1 Error converting bytecode to dex
<p>I am getting the following error since I updated the android studio from 2.0 to 2.1.</p>

<blockquote>
  <p>Error:Error converting bytecode to dex:</p>
  
  <p>Cause: Dex cannot parse version 52 byte code. This is caused by
  library dependencies that have been compiled using Java 8 or above. If
  you are using the 'java' gradle plugin in a library submodule add 
  targetCompatibility = '1.7' sourceCompatibility = '1.7' to that
  submodule's build.gradle file.</p>
</blockquote>

<p>I tried adding the following snippet in build.gradle, but still the issue persists</p>

<pre><code>    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
</code></pre>

<p>I saw some of the questions similar to this, but neither of the questions answered. Can anyone help me to solve this? Thanks in advance.</p>