AzureAD / microsoft-authentication-library-for-dotnet

Microsoft Authentication Library (MSAL) for .NET
https://aka.ms/msal-net
MIT License
1.41k stars 345 forks source link

Android latest support packages compatibility issues. #436

Closed daspuru closed 7 years ago

daspuru commented 7 years ago

The NuGet Package is not compatible with the latest android support packages. Your build is made with:

Xamarin.Android.Support.v7.AppCompat (23.0.0) Xamarin.Android.Support.CustomTabs (23.0.0)

And the latest version are 25.1.1

I hope you can make a build with that version so we can implement the MSAL library in Android platform, as it is impossible for already started apps to downgrade those packages.

I am testing AD B2C, and the problem is specifically with a class in the package Xamarin.Android.Support.CustomTabs, a missing method in the last version.

I tried to update the Android packages in this repo to recompile a Nuget in VS For Mac but I am not able to build in that IDE.

Thanks a lot!!!

adamhockemeyer commented 7 years ago

Same issue on Xamarin Android.

[MonoDroid] UNHANDLED EXCEPTION: [MonoDroid] System.MissingMethodException: Method 'Android.Support.CustomTabs.CustomTabsIntent.LaunchUrl' not found. [MonoDroid] at Android.App.Activity.n_OnResume (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/src/Mono.Android/obj/Release/android-25/mcw/Android.App.Activity.cs:4191 [MonoDroid] at (wrapper dynamic-method) System.Object:fe592bdf-d18d-444f-a38b-8fbbb6b1a36f (intptr,intptr) [art] JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable

kensykora commented 7 years ago

Running into a similar issue as @adamhockemeyer on the latest preview in Nuget

[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] System.MissingMethodException: Method 'Microsoft.Identity.Client.PublicClientApplication.AcquireTokenAsync' not found.
[MonoDroid]   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in <3fd174ff54b146228c505f23cf75ce71>:0 
[MonoDroid]   at MyApp.LoginService.UserLogin () [0x00013] in <c58d2f205e5d4cfea18a08f3743ca247>:0 
[MonoDroid]   at MyApp.MainPage+<WebUIClient_UserRequestedLogin>d__36.MoveNext () [0x00200] in /Users/kensykora/Workspace/myapp/src/myapp/MainPage.xaml.cs:182 
[MonoDroid] --- End of stack trace from previous location where exception was thrown ---
[MonoDroid]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <3fd174ff54b146228c505f23cf75ce71>:0 
[MonoDroid]   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <3fd174ff54b146228c505f23cf75ce71>:0 
[MonoDroid]   at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/src/Mono.Android/Android.App/SyncContext.cs:35 
[MonoDroid]   at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:36 
[MonoDroid]   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/src/Mono.Android/obj/Release/android-25/mcw/Java.Lang.IRunnable.cs:81 
[MonoDroid]   at (wrapper dynamic-method) System.Object:124afd82-e969-487a-bf70-d09b5bf64114 (intptr,intptr)
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
miltoncamara commented 7 years ago

I have the same ISSUE too. :(

daspuru commented 7 years ago

You have to downgrade some packages, check this Issue: https://github.com/Azure-Samples/active-directory-b2c-xamarin-native/issues/11#issuecomment-309564300

miltoncamara commented 7 years ago

@daspuru thx for try to helping, but when I try to downgrade CustomTabs, I can't use it with Azure Mobile SDK that requires CustomTabs 25.3.1 :(

SteveFarmerJr commented 7 years ago

I ended up going into the packages.config file and manually editing the CustomTabs package to 23.3. Seemed to do the trick as the other dependencies filled in after.

daspuru commented 7 years ago

@miltoncamara, I am using Azure Mobile Center and Azure Mobile Apps, without problems... These are my installed packages for the Android Project and everything works, as you can see I am using Microsoft.Azure.Mobile latest versions, I hope this helps:

{ "dependencies": { "Acr.UserDialogs": "6.3.10", "Autofac": "4.6.0", "ExifLib.PCL": "1.0.2-pre01", "Microsoft.Azure.Mobile": "0.13.0", "Microsoft.Azure.Mobile.Analytics": "0.13.0", "Microsoft.Azure.Mobile.Crashes": "0.13.0", "Microsoft.Identity.Client": "1.1.1-alpha0387", "Newtonsoft.Json": "10.0.3", "Plugin.CurrentActivity": "1.0.1", "Plugin.ImageResizer": "1.0.1-alpha", "Plugin.Permissions": "1.2.1", "sameerIOTApps.Plugin.SecureStorage": "1.2.2", "sqlite-net-pcl": "1.3.2", "System.Reactive.Linq": "4.0.0-preview00001", "Xam.Plugin.Media": "2.6.2", "Xam.Plugins.Messaging": "4.0.0", "Xamarin.Android.Support.Animated.Vector.Drawable": "25.3.1", "Xamarin.Android.Support.Compat": "24.2.1", "Xamarin.Android.Support.Core.UI": "24.2.1", "Xamarin.Android.Support.Core.Utils": "24.2.1", "Xamarin.Android.Support.CustomTabs": "23.3.0", "Xamarin.Android.Support.Design": "23.3.0", "Xamarin.Android.Support.Fragment": "24.2.1", "Xamarin.Android.Support.Media.Compat": "24.2.1", "Xamarin.Android.Support.Transition": "24.2.1", "Xamarin.Android.Support.v4": "24.2.1", "Xamarin.Android.Support.v7.AppCompat": "23.3.0", "Xamarin.Android.Support.v7.CardView": "23.3.0", "Xamarin.Android.Support.v7.MediaRouter": "23.3.0", "Xamarin.Android.Support.v7.Palette": "23.3.0", "Xamarin.Android.Support.v7.RecyclerView": "23.3.0", "Xamarin.Android.Support.Vector.Drawable": "23.3.0", "Xamarin.Build.Download": "0.4.5", "Xamarin.FFImageLoading.Forms": "2.2.10-pre-408", "Xamarin.Forms": "2.3.4.247", "Xamarin.GooglePlayServices.Location": "42.1024.0-beta1" }, "frameworks": { "MonoAndroid,Version=v7.1": {} }, "runtimes": { "win": {} } }

miltoncamara commented 7 years ago

@daspuru you are using Microsoft.Azure.Mobile, I think that library is to using with Azure Mobile Center, correct? I'm talking about Azure Mobile SDK, to connect with Azure Easy Tables do you know?

Follow LIB that I using

daspuru commented 7 years ago

@miltoncamara Yes you are right. I have not tested Azure Mobile SDK. Are you still having problems with those package versions? maybe you need to downgrade Azure Mobile SDK nuggets too :(

miltoncamara commented 7 years ago

@daspuru I also think so! :( but thank's so much for helping!

miltoncamara commented 7 years ago

@SteveFarmerJr You just changed the file without updating the package, correct?

lueyyou commented 7 years ago

Is this still a problem? We're trying to use 25.3.1 of CustomTabs due to other dependencies in the project and getting 'Microsoft.Identity.Client.PublicClientApplication.AcquireTokenAsync' not found.

I'm trying to update to 1.1.0 preview from 1.03 alpha and this wasn't happening in the alpha Nuget package

jangaehler commented 7 years ago

Same Error here, downgrade is not helping.

daspuru commented 7 years ago

If one of you all is using VS 2017, I read in other thread that someone could recompile the MSAL library with the latest Android.Support.* packages and remake the NuGet. The problem is that the solution of MSAL does not work in VS for Mac, which is the tool I am using. Please if anyone can do that and works, it would be great to have that NuGet.

Greetings to all.

kpanwar commented 7 years ago

We have a nightly out with he fix. Duplicate of #443

robintschroeder commented 7 years ago

+1

I can't downgrade to the earlier droid libraries. Is there a more recent alpha library that has been fixed? I am experiencing the error with MSAL 1.1.0, 1.1.1-alpha0388 and 1.1.1-alpha0390.

Using 25.3.1 of the Xamarin.Android.Support libraries

Any help here would be appreciated!

Stack Trace: 09-29 15:20:35.254 I/MonoDroid(27963): at (wrapper dynamic-method) System.Object:4892706f-bea6-471d-9fb3-022b8eb00bf9 (intptr,intptr) 09-29 15:20:35.271 W/art (27963): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable 09-29 15:20:35.278 D/Mono (27963): DllImport searching in: '__Internal' ('(null)'). 09-29 15:20:35.278 D/Mono (27963): Searching for 'java_interop_jnienv_throw'. 09-29 15:20:35.278 D/Mono (27963): Probing 'java_interop_jnienv_throw'. 09-29 15:20:35.278 D/Mono (27963): Found as 'java_interop_jnienv_throw'. An unhandled exception occured.

09-29 15:20:40.023 E/mono (27963): 09-29 15:20:40.023 E/mono (27963): Unhandled Exception: 09-29 15:20:40.023 E/mono (27963): System.MissingMethodException: Method 'Microsoft.Identity.Client.PublicClientApplication.AcquireTokenAsync' not found. 09-29 15:20:40.023 E/mono-rt (27963): [ERROR] FATAL UNHANDLED EXCEPTION: System.MissingMethodException: Method 'Microsoft.Identity.Client.PublicClientApplication.AcquireTokenAsync' not found.