title: Android Studio errors after adding external library
body: <p>I've got the following problem:</p>
  
  <p>I'm programming an app which is using Google Maps and I wanted to add this external lib</p>
  
  <p><a href="https://github.com/route360/r360-java" rel="nofollow">https://github.com/route360/r360-java</a></p>
  
  <p>I wanted to add the lib as .jar file into Android Studio, so I compiled it with Maven using Java 8 (Compiling with Java 7 didn't work).</p>
  
  <p>After adding the .jar as lib and adding it to the dependencies and running the app I get the following error messages:</p>
  
  <pre><code>Error:PARSE ERROR:
  Error:unsupported class file version 52.0
  Error:...while parsing net/motionintelligence/client/Constants.class
  Error:1 error; aborting
  :app:transformClassesWithDexForDebug FAILED
  Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
  &gt; com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_91\bin\java.exe'' finished with non-zero exit value 1
  </code></pre>
  
  <p>After some research in SO I found out that this may be the result of a wrong Java version I'm using so I installed Java 7, changed the Android Studio JDK to Java 7 and tried to run the app. The result is the following:</p>
  
  <pre><code>Error:java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
  Error:  at java.lang.ClassLoader.defineClass1(Native Method)
  Error:  at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
  Error:  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
  Error:  at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
  Error:  at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
  Error:  at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
  Error:  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  Error:  at java.security.AccessController.doPrivileged(Native Method)
  Error:  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  Error:  at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
  Error:  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
  Error:  at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
  Error:  at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
  Error:Exception in thread "main" 
  :app:transformClassesWithDexForDebug FAILED
  Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
  &gt; com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1
  </code></pre>
  
  <p>I'm tried switching between the Android API's but no solution from SO worked out for me.</p>
  
  <p>At the moment im using API 23 Android 6.0. </p>
  
  <p>Here my build.gradle file of the submodule:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion '24.0.0'
  
      defaultConfig {
          applicationId "com.example.jule.bachelorapp"
          minSdkVersion 9
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_7
          targetCompatibility JavaVersion.VERSION_1_7
      }
      dexOptions {
      }
  }
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      testCompile 'junit:junit:4.12'
      compile 'com.google.android.gms:play-services:9.0.2'
      compile 'com.google.android.gms:play-services-ads:9.0.2'
      compile 'com.google.android.gms:play-services-auth:9.0.2'
      compile 'com.google.android.gms:play-services-gcm:9.0.2'
      compile files('libs/r360-java-client-0.0.1.jar')
  }
  </code></pre>
  
  <p>Does anyone know how to get rid of those errors ? I really need to use that library so help would be highly appreciated.</p>