Reputation: 1416
Gradle build is failing with following app's build.gradle config:
android{
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.sample.demo"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-std=c++11 -frtti -fexceptions"
// abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'mips', 'mips64'
abiFilters 'armeabi-v7a'
}
}
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
sourceSets {
main {
jniLibs.srcDirs = ['src/main/jniLibs']
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
Below is the error log for the same:
:app:transformClassesWithDesugarForDebug
Exception in thread "main" java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at com.google.devtools.build.android.desugar.CoreLibraryRewriter.reader(CoreLibraryRewriter.java:44)
at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:388)
at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:326)
at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:280)
at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:584)
I have tried most of the other solutions like:
In all, these are popular answers around for this exception on SO and none of them have worked for me. I could have posted the complete log with stacktrace but SO thinks its more code than details and thus not allowing me to do the same. Though let me know if anything else is required and I will make alternate arrangements.
Upvotes: 3
Views: 1181
Reputation: 298459
The only place where org.objectweb.asm.ClassReader
’s constructor throws an IllegalArgumentException
is at the class file version check.
So either,
Upvotes: 1