com.android.support:customtabs: No virtual method launchUrl - android

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?

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.

Related

Android Webview Chromium UnitTests fail with java.lang.NoSuchMethodError

We are currently facing this NoSuchMethod Error when we want to create the unit test with Robolectric version 4.3.1 and Mockito version 2.18.3
Exceptions:
java.lang.NoSuchMethodError: 'void com.android.webview.chromium.WebViewChromium.<init>(com.android.webview.chromium.WebViewChromiumFactoryProvider, android.webkit.WebView, android.webkit.WebView$PrivateAccess, boolean)'
Here is the code we did:
mWebView = Mockito.spy(
new WebviewChromium(
mockWebViewChromiumProvider, webView, webView.new PrivateAccess(), false));
In BUILD.gn, we have included the "//android_webview/glue:glue_java" as dependency, we can successfully compile the code but it sounds like in the runtime, it refers to the another wrong jar, does someone know how to config the build file to use the correct jar or any ideas about how to solve this error?
did you check this followjng thread https://github.com/robolectric/robolectric/issues/5092 and this one I think you need open jdk 11 or 13 I recently had the same issue after adding open jdk 13 to android studio it solved my problem robolectric started working fine you can check following thread as well https://github.com/robolectric/robolectric/issues/5092

How to Solve "The "XamlCTask" task failed unexpectedly" error without updating xamarin.forms version

I am stuck in one of my issue in xamarin.forms. In my xamarin.form project xamarin.form package version is 2.3.2.123 in PCL,Android and IOS.
Since Last few days when I am trying to build my iphone project, its gives me an error
The "XamlCTask" task failed unexpectedly
So I have updated xamarin.form version in PCL, Droid and IOS.
but due to this I am facing issue in Android in one of my page
{Java.Lang.NullPointerException: Attempt to invoke virtual method
'boolean android.graphics.Bitmap.isMutable()' on a null object
reference at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ()
[0x0000c] in <3fd174ff54b146228c505f23cf75ce71>:0 …}
I am using
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
Instead
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
because I want to scroll page even when keyboard is open. If keyboard is open then page can't be scroll in android this is the bug of "App Compact".
Now I don't understand what should I do?
Is there any other way to solve "The "XamlCTask" task failed unexpectedly" error without updating xamarin.forms version.
because all the issues arise due to xamarin.forms updation.
In one of other project I am using same xamarin.forms version but it works perfectly. What is actual reason of "XamlC task failed" error?
Although the cause seems different, it looks like it's a known bug. Maybe you could verify that upgrading to the version mentioned in the bug (2.3.5-pre) works for you, and then either disable XAML compilation for the time being, or work with the Xamarin pre-release packages.

C++ Exception in 'nativeRequireModuleConfig', What is Landroid?

C++ Exception in 'nativeRequireModuleConfig':
java.lang.NoSuchMethodError: No static method getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File; in class Lcom/google/android/gms/common/util/zzx; or its super classes (decleration of 'com.google.android.gms.common.util.zzx' appears in /data/app/com.kotac-2/base.apk)
To avoid this error you can modify the project into a working state, for example if your project is on git and versioned, reset it into an older commit which it is working well.
I was able to get over this issue by getting the app working however and updating the code again.

Unable to install the fabric plugin (for crashlytics) on Android Studio

Unable to download the Fabric plugin on Android studio. I am able to download other plugins on the same network, so not an issue with the connectivity.
As an alternative, i tried manual installation of the plugin. But with manual installation, the plugin somehow does not launch (ends with an exception).
So I am back to this. Is anyone else facing this issue ?
P.S - I am on Android Studio 2.2.2
P.S - Below is the crash log when i install the plugin manually and restart Android Studio (Some part of the crash stack removed for brevity)
Plugin 'com.crashlytics.tools.androidstudio' failed to initialize and will be disabled. Please restart Android Studio.
java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of com/intellij/ide/plugins/cl/PluginClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of com/intellij/util/lang/UrlClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:299)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
at com.crashlytics.tools.bootstrap.osgi.OsgiBootstrapper.<clinit>(OsgiBootstrapper.java:54)
at com.crashlytics.tools.intellij.CrashlyticsPlugin.initComponent(CrashlyticsPlugin.java:89)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:522)
at

NPE on Facebook SDK 4.10 : Attempt to invoke interface method 'java.lang.Object com.facebook.inject.Lazy.get()' on a null object reference

Background
Recently we've updated the Facebook SDK library to 4.10 (from here).
Before, we had the same bug now and then, but now it seems it occurs a lot more often.
The problem
There is no way for us to understand where and why it occurs.
Here's the crash log:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke
interface method 'java.lang.Object com.facebook.inject.Lazy.get()' on
a null object reference
at android.os.Parcel.readException(Parcel.java:1552)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
at android.content.ContentResolver.query(ContentResolver.java:494)
at android.content.ContentResolver.query(ContentResolver.java:429)
at com.facebook.internal.NativeProtocol.fetchAllAvailableProtocolVersionsForAppInfo(NativeProtocol.java:790)
at com.facebook.internal.NativeProtocol.access$000(NativeProtocol.java:49)
at com.facebook.internal.NativeProtocol$NativeAppInfo.fetchAvailableVersions(NativeProtocol.java:281)
at com.facebook.internal.NativeProtocol$NativeAppInfo.access$600(NativeProtocol.java:226)
at com.facebook.internal.NativeProtocol$1.run(NativeProtocol.java:763)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
And, since it's a report from Crashlytics, I also have some statistics:
usually (90%) occurs on Meizu devices, and the rest on LG, Samsung and others.
usually (72%) occurs on Android 5.1 versions, and the rest on all of the other versions we support (4.x and above).
What I've tried
I tried searching for the exception, but I can't find anything even similar to it.
I tried to find the "com.facebook.inject.Lazy" class, but this is nowhere to be found. I can't even find injection related classes and repos that the sdk uses for normal use. Only for unit testings.
I also tried to go to the Github website of Facebook (here), but there is nowhere to write there.
Later I've found that this was reported on Facebook's developers website , but it doesn't seem that it's going to be fixed, and nobody knows how to handle it.
EDIT: now I've found this Facebook post, which says it might be because of using an old version of Facebook app, but it seem that it's incorrect.
The question
Why does it occur? Is there any workaround for this? Does Facebook work on a fix for this?
Is there any version of the Facebook SDK that this issue doesn't occur?
And, most importantly, How can it be handled and fixed?
Please use updated facebook sdk to overcome this error. old sdk has some problems.
you can download latest sdk from
https://developers.facebook.com/docs/android

Categories

Resources