Why cannot compile Android App with JDK11?

Viewed 524

I have setup an empty Basic Activity in Android Studio and I have set the following

android {
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }
}

but it seems that the android jar packages are not seen when building

> Task :app:compileDebugJavaWithJavac FAILED
error: package android.annotation does not exist
import android.annotation.SuppressLint;

error: package android.content does not exist
import android.content.Intent;
...

and many other packages from the android.jar file are not seen

0 Answers
Related