[SOLVED] Android & Gradle error: Default interface methods are only supported starting with Android N (–min-api 24) – easy solution!

You are currently viewing [SOLVED] Android & Gradle error: Default interface methods are only supported starting with Android N (–min-api 24) – easy solution!
Photo by Guido Coppa on Unsplash
Share This Post, Help Others, And Earn My Heartfelt Appreciation! :)
4.9
(894)

Reason -> Default interface methods are only supported starting with Android N

You will receive the error [ Default interface methods are only supported starting with Android N] due to the missing “compileOptions” configuration in the AndroidManifest.xml file.

Solution -> –min-api 24

Add the missing configuration. Example below.

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

Official docs from Google

The Android SDK Platform package. This is required to compile your app for that version.

Several System Image packages. At least one of these is required to run that version on the Android Emulator.Each platform version includes a system image for each supported form factor (handsets, Android TV, and Android Wear). Each form factor may offer variations to match your computer’s processor architecture (such as Intel x86 and ARM EABI). System images labeled Google APIs include access to Google Play services and those labeled Google Play also include Google Play Store.

The Sources for Android package. This includes the source files for the platform. Android Studio may show lines of code from these files while you debug your app.

The revision numbers listed below are for the Android SDK Platform package only. The system images may receive separate updates, usually to resolve bugs with the emulator. There are no release notes for the system images, but you should always keep them up to date.

https://developer.android.com/studio/releases/platforms

If you enjoyed this post please add the comment below and share this post on your Facebook, Twitter, LinkedIn or another social media webpage.
Thanks in advanced!

How useful was this post?

Click on a star to rate it!

Average rating 4.9 / 5. Vote count: 894

No votes so far! Be the first to rate this post.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments