Directly above the picture
, the solution is to add the following code under build.gradle under the APP.
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.wuyr.catchpiggy"
minSdkVersion 16
targetSdkVersion 26
versionCode 2
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
//todo 添加的代码
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
Okay, after adding it, click Sync Now in the upper right corner , and the bug will be solved.