I got follow error when I use lambda to traverse String array.
java.lang.NoClassDefFoundError: com.twsz.app.ivybox.alarm.CreateOrUpdateAlarmActivity$$Lambda$1
at com.twsz.app.ivybox.alarm.CreateOrUpdateAlarmActivity.initView(CreateOrUpdateAlarmActivity.java:143)
at com.twsz.app.ivybox.alarm.CreateOrUpdateAlarmActivity.onCreate(CreateOrUpdateAlarmActivity.java:73)
This is my code.I know it's ok for traditional way to traverse the String array ,but why this happen when I use lambda.
String[] days = dayOfWeek.split(",");
Arrays.asList(days).forEach(day->{
int index = Integer.valueOf(day) -1;
checkBoxList.get(index).setChecked(true);
});//where happens NoClassDefFoundError
My build.gradle file
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.twsz.app.ivybox"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dataBinding {
enabled = true
}
}
Thanks for any help.