Java 8 aar library requires minimum sdk version 26

I am trying to add an android library with Java 8 features to Unity. I get the following error while trying to build:

CommandInvokationFailure: Unable to convert classes into dex format.
/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“/Users/abhipray/Library/Android/sdk/tools” -Dfile.encoding=UTF8 -jar “/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar” -

stderr[
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
1 error; aborting
]

I don’t see an option for min-sdk-version as 26 via player settings using unity 2017.3.0b8.

How do I set the min-sdk-version to 26 or is there another solution to this error?

Found a solution. I fixed this by using the Gradle build option and adding a .gradle file to Plugins/Android/mainTemplate.gradle. The gradle file needs the following:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

Unity comes bundled with gradle-wrapper 4.0.1 but because 1.8 language features require gradle, I replaced 4.0.1 found in Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/gradle with 4.1.