赞
踩
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (17) and 'kaptGenerateStubsDebugKotlin' (1.8).
我的AS修改后需要重新打开项目,否则不起效果。
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
R
<manifest package="com.xxx.xxx">
升级kotlin 1.9.0之后需要把Room升级到2.6.0+,否则编译错误。
升级Java 17 导致的 sealed 修饰符问题。
解决方法:
pluginManagement {
buildscript {
repositories {
mavenCentral()
maven {
url = uri("https://storage.googleapis.com/r8-releases/raw")
}
}
dependencies {
classpath("com.android.tools:r8:8.2.24")
}
}
AIDL
编译默认false,需要手动开启需要手动开启,才可以生成对应的java文件
buildFeatures {
aidl = true
}
buildConfig
默认false,需要手动开启需要手动开启buildConfig
支持,否则会找不到对应的类BuildConfig.java
buildFeatures {
buildConfig = true
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。