Home » Android » chrome custom tabs – com.android.support:customtabs: No virtual method launchUrl

chrome custom tabs – com.android.support:customtabs: No virtual method launchUrl

Posted by: admin June 15, 2020 Leave a comment

Questions:
java.lang.NoSuchMethodError: No virtual method launchUrl(Landroid/app/Activity;Landroid/net/Uri;)V in class Landroid/support/customtabs/CustomTabsIntent

Before everything worked, but today I can see the above error.
Why it happens? if something was changed, why not backwards-compatible?

How to&Answers:

Don’t know if it helps you but in my case (I have Facebook SDK in my app with custom tabs enabled) this error happened when user (without installed Facebook app) tried to log in.

Exception java.lang.NoSuchMethodError: No virtual method launchUrl(Landroid/app/Activity;Landroid/net/Uri;)V in class Landroid/support/customtabs/CustomTabsIntent; or its super classes 
com.facebook.internal.CustomTab.openCustomTab (CustomTab.java:48)

Updating dependency to use latest SDK version (they switched to customtabs:25.0.0 in version 4.17.0)

compile 'com.facebook.android:facebook-android-sdk:4.17.0'

fixed the problem.

I also use Custom Tabs (v25.0.0) in my app and have no issues with them. If it’s not your case you can check what they’ve changed.