microsoft-authentication-library-for-dotnet: Microsoft.Identity.Client.AuthenticationContinuationHelper class not found in Xamarin.Android project v3.0.8 nuget

Which Version of MSAL are you using ? Note that to get help, you need to run the latest version. Preview version are also ok. For ADAL, please log issues to https://github.com/AzureAD/azure-activedirectory-library-for-dotnet 3.0.8

Platform Xamarin.Android

What authentication flow has the issue?

  • Desktop / Mobile
    • Interactive
    • Integrated Windows Auth
    • Username Password
    • Device code flow (browserless)
  • Web App
    • Authorization code
    • OBO
  • Web API
    • OBO

Other? - please describe;

Is this a new or existing app? new application

Repro clone https://github.com/Azure-Samples/active-directory-b2c-xamarin-native upgrade nuget package from 3.0.5-preview to 3.0.8 watch the android app break because of missing class AuthenticationContinuationHelper. weirdly the class is found in iOS project.

        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);
            
            AuthenticationContinuationHelper.SetAuthenticationContinuationEventArgs(requestCode, resultCode, data);
        }

**Expected behavior**
AuthenticationContinuationHelper should be a known class

**Actual behavior**
AuthenticationContinuationHelper class not found

**Possible Solution**
problem with nuget package?


![image](https://user-images.githubusercontent.com/3155241/57136036-81f07280-6d79-11e9-9e30-53a40438acbc.png)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 31 (7 by maintainers)

Most upvoted comments

@markti closing…thanks for the help today.

You caught us during our shift change… from UK support to Seattle area support. Lol

I’m based in Cambridge UK 😃 Most of the team is in Seattle. We just like to offer 24h service like that 😄

working on 3.0.8 after manually changing the path in the csproj…

image

Oh interesting, I gotta check the csproj too…

image

look at that nasty!

manually changed to monodroid90…rebuild…

if this works ill submit a PR back from my fork…

image

image

rebuild after nuget upgrade…now seeing missing class in android only…

image

changing target framework to android 9.0

image

rebuild android project…

image

same error…

checking packages.config…Microsoft.Identity.Client is targetframework monodroid81

image

however, nuget is in following folder

image

D’ISSA BOM BAD!!! MEESA TINKS!

found the issue, ja?

image

however monodroid81 is all over the place in my packages.config…what would cause it to bump to monodroid90?

@jennyf19 @bgavrilMS Shall I upgrade the Xamarin.Android.Support.* projects from 27.0.2 to 28.0.1?

clean clone and working on android API 23 device…but this is only working on 3.0.5-preview @jennyf19

image

kinda early in seattle eh? 😃

forking and starting over…

Ok, let me look directly at that sample. I will get it to work and push a PR onto it.

Hi @markti , I think I know what is going on. In MSAL 3.0.8 we’ve set the minimum version of Xamarin.Android to 9.0; Your project probably targets a previous framework.

So what Visual Studio will do (actually NuGet), is try to match MSAL to your poject. MSAL is multi-frameowrk, and supports Xamarin.Android 9 and NetStandard 2. NuGet will try to use the Xamarin version first, but it fails, because your app uses a lower version. It will then try to use the NetStandard version.

However, NetStndard version of MSAL has no Activity, AuthenticationContinuationHelper or any other Android specific type. This is why you see the failure.

We will look into making MSAL support a lower version of Android (@jennyf19 , @henrik-me @MarkZuber - I was under the impression that we support both N and N-1 for Android?).

In the meantime, could you just have your android head target Android 9 please? As far as I know, this only affects the SDK, not where your app can be intalled.

image