问题描述
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?
推荐答案
不知道它是否对您有帮助,但就我而言(我的应用程序中有Facebook SDK,带有),当用户(未安装Facebook应用)尝试登录时,发生了此错误.
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)
更新依赖关系以使用最新的SDK版本(在4.17.0版本中,它们已切换到customtabs:25.0.0)
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'
解决了这个问题.
我还在我的应用程序中使用了自定义标签"(v25.0.0),并且没有任何问题.如果不是您的情况您可以检查它们的更改.
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.
这篇关于com.android.support:customtabs:没有虚拟方法launchUrl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!