Invoke-customs are only supported starting with Android O ( — min-api 26) — Solution

Error:

The stack trace log is:

Error: Invoke-customs are only supported starting with Android O (--min-api 26)

Reason:

Possibly, one of the reason for this Invoke-customs support error is using the Lambda functions/Expressions instead of inline callbacks as the Lambda functions/Expressions are introduced in Java 8 and application must be compatible with Java 8 to use them.

There might be many other reasons behind the error, the above one is something I understood. If you know anymore info/reasons regarding the error, let me know in comments I will update them in the article.

Solution -1 (Tested and Working):

Adding the below snippet in build.gradle(App level)

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

I have tested this solution and it resolves the error.

Solution 2 (Not Tested):

Disable ‘Instant Run’.

Android Studio -> File -> Settings -> Build, Execution, Deployment -> Instant Run -> Disable checkbox

I’m unable to test this solution as option for Disabling Instant Run is not available in current Android Studio version (3.6.2). Instant Run is directly available with ‘Run App’ option.

That’s all about “Invoke-customs are only supported starting with Android O ( — min-api 26)” Error and its solution. Please do let me know Any info regarding this error I have missed in this article and any other solutions to resolve this error in comments. I will update them in the article.

Check out my blog:

Invoke-customs are only supported starting with Android O ( — min-api 26) — Solution — Techie Teacnings (techieteachings.com)

--

--

--

Android App Developer and Tech Enthusiast

Love podcasts or audiobooks? Learn on the go with our new app.

Let’s add some player ammo

Setting up CI/CD for a PREN app with Jenkins, Docker and GitHub Webhooks on Container Registry

A Look Back Into Architecture and Service Mesh in 2020

Shell_Bind_TCP Shellcode

[Leetcode] Kth Smallest Element in a BST

Techie heart vs. entrepreneurial mind

Comparing Alibaba Cloud ApsaraDB for RDS and MySQL Database Hosted On ECS Instances

SimScale’s Values — Part 4

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Akhil Battula

Akhil Battula

Android App Developer and Tech Enthusiast

More from Medium

Creating Android app with all social logins and authentications with 3 simple steps

Android Custom Button Vertical Left Bottom Alignment with Icon

What is Android Manifest?

Expert: Courier App MVVM Jetpack (HMS Account and AuthService) in Android using Kotlin- Part-1