Android Studio 2.1
Java 7 compiler or java 8 compiler
gradle 2.10 or 2.13
build.gradle file:
//////////////////////////////////
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.bignerdranch.android.splineinterpolation"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
jackOptions {
enabled false
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'me.tatarka:gradle-retrolambda:3.2.5'
}
}
// Required because retrolambda is on maven central
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'org.apache.commons:commons-math3:+'
compile 'org.apache.commons:commons-lang3:+'
compile 'org.rajawali3d:rajawali:1.+@aar'
compile 'com.annimon:stream:1.0.9'
compile 'org.jetbrains:annotations:15.0'
}
apply plugin: 'me.tatarka.retrolambda'
//Its only experimental. If remove this error is same
retrolambda {
jdk "/usr/lib/jvm/java-8-oracle"
oldJdk "/usr/lib/jvm/java-7-oracle"
javaVersion JavaVersion.VERSION_1_7
defaultMethods false
incremental true
}
//////////////////////////////////
In Android Studio messages:
Error:Error converting bytecode to dex:
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.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
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: Return code 1 for dex process