标签: android android-studio gradle android-gradle
如何解决以下错误?
android { ... compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } ... }
Android Studio->文件->项目结构->模块-> 未解决的参考:JavaVersion.VERSION_1_8
答案 0 :(得分:3)
我将buildscript变量的根build.gradle的{{1}}部分添加了
buildscript
build.gradle
ext.java_version
,然后将模块的buildscript { ... ext.java_version = JavaVersion.VERSION_1_8 ... } build.gradle更改为JavaVersion.VERSION_1_8
buildscript { ... ext.java_version = JavaVersion.VERSION_1_8 ... }
JavaVersion.VERSION_1_8
java_version
现在一切正常。