8
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?

pvllnspk
  • 5,667
  • 12
  • 59
  • 97
  • Could you post the support library version you are using and, if possible, the section of code that is launching the Custom Tabs? – andreban Nov 02 '16 at 13:52
  • latest version, latest code from official github sample app – pvllnspk Nov 02 '16 at 14:14
  • Are you getting the error on this line? https://github.com/GoogleChrome/custom-tabs-client/blob/master/Application/src/main/java/org/chromium/customtabsclient/MainActivity.java#L191 – andreban Nov 02 '16 at 14:42

1 Answers1

16

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.

mat
  • 337
  • 1
  • 9
  • This is still an issue with the following dependencies : `compile "com.android.support:customtabs:25.0.1"` and `compile 'com.facebook.android:facebook-android-sdk:4.19.0'` – Etienne Lawlor Jan 27 '17 at 05:23
  • Looks like the issue is documented here as well https://github.com/firebase/FirebaseUI-Android/issues/398 – Etienne Lawlor Jan 27 '17 at 05:29