今天升级 Android studio 4.2 之后 项目里面有 2 个 module 是 java-library 的 一直报错
感觉是 jdk 找不到了 改成 android-library 才好
什么情况?以后 Android Studio 不支持写纯 java 项目了??
环境:Android Studio4.2
gradle:4.2.0
异常配置
plugins {
id 'java-library'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
修复后配置
plugins {
id 'com.android.library'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
1
Gloomyer OP 环境:Android Studio4.2
gradle:4.2.0 异常配置 ``` plugins { id 'java-library' } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) } sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 ``` 修复后配置 ``` plugins { id 'com.android.library' } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) } sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 ``` |
2
Gloomyer OP 自己傻逼了,看下了更新说明 project jdk 换成 jdk11 就好了
|