第1部分 :-
获得此版本的 Android Studio 后,我可以使用JDK17在我的项目中。
一切都很好,没有构建失败,没有运行时错误等。
(就像增强开关工作正常)
....但是这个警告在每次构建过程中都会不断出现。有什么办法可以suppress this?
(Warning Text -> "One or more classes has file version >= 56 which is not officially supported")
这些是 build.gradle 文件:
(1):-
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.0-rc01'
classpath 'com.google.android.gms:strict-version-matcher-plugin:1.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
(2):-
apply plugin: 'com.android.application'
apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'
android {
compileSdkVersion 32
buildToolsVersion '32.0.0'
defaultConfig {
applicationId "com.Sujal_Industries.SelfEmot"
minSdkVersion 21
targetSdkVersion 32
versionCode 11
versionName "1.3.1"
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.recyclerview:recyclerview:1.3.0-alpha01'
implementation 'androidx.core:core-splashscreen:1.0.0-beta01'
implementation 'com.google.mlkit:image-labeling:17.0.6'
implementation 'com.google.android.material:material:1.6.0-alpha01'
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
implementation 'io.reactivex.rxjava3:rxjava:3.1.3'
}
(我尝试搜索类似的警告但没有运气)
第2部分 :-
Recently, I found that Android Studio is now showing the option to create a new Java Record.
But when I create one and build the project, this error pops up:
那么..有什么方法可以强制添加Recordjava.lang包中的类?
(如果需要更多信息/澄清,请告诉我)
Edit:我知道 11 以上的版本不是正式支持,但是没有解决办法吗?