可能有其他方法,我是这样解决的,在module的build.grade文件加入以下搞定 compileOptions { sourceCompatibility 1.8 targetCompatibility 1.8 }