1
votes

I am using Xamarin.Auth to authenticate to my identity provider with implicit flow on Android. I can't get the native ui (chrome custom tabs) to work with Xamarin.Auth as I get the following error:

UNHANDLED EXCEPTION: 06-30 11:40:48.903 I/MonoDroid( 7670): System.MissingMethodException: Method 'Android.Support.CustomTabs.CustomTabsIntent.LaunchUrl' not found. 06-30 11:40:48.903 I/MonoDroid( 7670): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x0000f] in <93e2413825534efca8b597098003b511>:0 06-30 11:40:48.903 I/MonoDroid( 7670): at (wrapper dynamic-method) System.Object:ce197f13-7701-4b2e-840f-19029a77ef6c (intptr,intptr,intptr) 06-30 11:40:48.913 W/art ( 7670): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable 06-30 11:40:48.918 D/HockeyApp( 7670): Writing unhandled exception to: /data/user/0/com.mycompany.myapp/files/9a7dae18-3c5a-4e97-b7cb-4a3f1581c690.stacktrace

My authenticator is set up like this:

var authenticator = new OAuth2Authenticator(
    AuthSettings.ClientId, 
    AuthSettings.Scope,
    new Uri(AuthSettings.AuthorizeUrl), 
    new Uri(AuthSettings.RedirectUrl),
    null,
    true);

I am not using linking either.

Any ideas?

1

1 Answers

0
votes

After a quick google search I came accross an issue thread on a github page for the 'SharePlugin' for Xamarin, fortunately James Montemagno is in their helping out. The issue listed is similar to yours so for reference purposes it can be found Here.

It appears to have been a fairly common issue with this method 'Android.Support.CustomTabs.CustomTabsIntent::LaunchUrl'. In that thread they obviously mention that:

Release Mode => Linker option => None , Every thing works.

So that's worth double checking, to make sure that's what you're doing. (I realise you've mentioned you've had a look at the linked assemblies, but always worth a double check).

There is also some conversation on the GitHub repository for Xamarin.Auth iteself, a particular issue found Here talks about the versions of both Xamarin Auth and Xamarin Forms, needing to match in a certain way, I would suggest updating xamarin.forms to it's latest version, and trying again, perhaps even downgrading Xamarin.Auth.

It worked with 1.5.0-alpha-03. Tried with 1.5.0-alpha-09 but it failed.