After getting this version of Android Studio, I am able to use JDK17 in my project. Everything works great, no build fails, no runtime error, etc. (like enhanced-switch is working fine) ....but this warning keeps coming during each build. Is there any way to suppress this?
(Warning Text -> "One or more classes has file version >= 56 which is not officially supported")
These are the build.gradle files:
(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'
}
(I tried searching for similar warnings but no luck)
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:
So.. is there any way to forcefully add that Record class in java.lang package?
(If any more information/clarification is needed on this, please let me know)
Edit: I am aware of the fact that versions above 11 aren't officially supported but isn't there a workaround?
As of Android 14 SDK I can attest that all of the Java 17 language features below works flawlessly in a running app, neat! Code autocompletion and inspection also works for me.
Here they write:
Android 14 includes features and improvements that further align with the OpenJDK 17 LTS release, including both library updates and Java 17 language support for app and platform developers.
I only get a Build warning saying that my Android Gradle plugin (8.0.2) hasn't been "tested with compileSdk = 34". If you were to update Android Studio to the Beta or Canary channels with newer Android Gradle plugins, I'm sure the warning would disappear. I'm using the current official version:
To start using Java 17 language goodies, set up the Android 14 SDK:
And in your app's build.gradle (using Groovy):
android {
compileSdk 34
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}