본문 바로가기

Android/Issue

Static interface methods are only supported starting with Android N (--min-api 24)

AndroidX 로 Refactor 후 apk를 빌드하면 에러가 발생할 수 있다.

나의 경우 발생한 정확한 에러는 아래와 같다.

Static interface methods are only supported starting with Android N (--min-api 24): androidx.browser.trusted.TrustedWebActivityDisplayMode androidx.browser.trusted.TrustedWebActivityDisplayMode.fromBundle(android.os.Bundle)

조금더 상세한 내용은 아래 링크를 참고하도록 하자.

https://android.jlelse.eu/features-of-revolutionary-release-java-8-for-android-d8abe06c34c5

 

Features of revolutionary release -Java 8 for Android

Java 8 is a mountainous step for the Java language. The ratification of Java 8 is a big deal for Android on the whole and will no doubt…

android.jlelse.eu

여튼 수정 방법은 build.gradle (:app) 파일을 열어 아래 부분을 추가해준다.

android {
    ...
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}