未找到方法 'Android.Support.CustomTabs.CustomTabsIntent.LaunchUrl'

Method 'Android.Support.CustomTabs.CustomTabsIntent.LaunchUrl' not found

正在尝试使用 Microsoft.Identity.Client v1.1.0-preview 通过 Microsoft 对用户进行身份验证。当我执行 App.IdentityClientApp.AcquireTokenAsync 时,即使周围有 try/catch,它也会终止应用程序。

android 设备日志显示

Info 6756 MonoDroid System.MissingMethodException: 
  Method 'Android.Support.CustomTabs.CustomTabsIntent.LaunchUrl' not found.
  at Android.App.Activity.n_OnResume (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <e975227ac8644a30bb0866117325de0d>:0 
  at (wrapper dynamic-method) System.Object:40d0e467-e2e5-447f-a0b5-87cb60ce49a7 (intptr,intptr)  

如果您尝试仅在发布模式下构建,它不会。它在输出 window 中有类似的错误。

Mono.Linker.MarkException: 
Error processing method: 'System.Void Microsoft.Identity.Client.AuthenticationActivity::OnResume()' in assembly:
 'Microsoft.Identity.Client.dll' ---> Mono.Cecil.ResolutionException: 
  Failed to resolve System.Void
  Android.Support.CustomTabs.CustomTabsIntent::LaunchUrl(Android.App.Activity,Android.Net.Uri)

有谁知道他们是否刚刚放弃了这段代码,或者更好的是,知道如何让它工作吗?它曾经适用于 iOS,但现在即使在登录过程完成后也有一些问题。

我最近在Android上用Microsoft.Identity.Client的时候体验不好,请注意接下来的事情:

  • 使用最新的夜间构建而不是预览版
  • 确保您满足所有要求:Android Lollipop+ & Google Chrome 已安装
  • 仔细关注official guide
  • 关注github project page,我在那里找到了大部分解决方案

manifest好像有问题with a custom URL scheme,我先重新检查一下。