Invoke-customs are only supported starting with Android O (--min-api 26)
一直提示这个错误 , 网上大部分搜到的解决方案都是 :
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
当我加上这句的时候 还是提示同样的错误
最后在stackoverflow上找到相关内容 https://stackoverflow.com/a/53078104/11398050
If compileOptions doesn't work, try this
Disable 'Instant Run'.
Android Studio -> File -> Settings -> Build, Execution, Deployment -> Instant Run -> Disable checkbox
需要关闭
Instant Run
这个选项
Android Studio -> File -> Settings -> Build, Execution, Deployment -> Instant Run -> Disable checkbox