No static field msalApp
Opened this issue · 8 comments
I do not know what I am doing wrong. I followed the readme file but I get the following exception
E/flutter (19355): [ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(39)] java.lang.NoSuchFieldError: No static field msalApp of type Lcom/microsoft/identity/client/IMultipleAccountPublicClientApplication; in class Luk/co/moodio/msal_flutter/MsalFlutterPlugin$Companion; or its superclasses (declaration of 'uk.co.moodio.msal_flutter.MsalFlutterPlugin$Companion' appears in /data/app/com.example.flutter_app1-swehphgquUI3YKtyjLgW9A==/base.apk!classes3.dex)
Hmm, did you call the initialize function in the dart code before acquiring the token? That should throw a platform error but maybe I missed something.
Also, in your msal configuration file can you confirm if youve changed any of the properties? Specifically if you've change the account type to single?
@mswehli I have copied your example folder to a new folder. There it works. I will now find the diffs to my project.
I can confirm that I have changed the redirect uri only.
@michaelmairegger oh ok. Please let me know if you figure out what went wrong. I'll make sure to update the readme or to fix it.
@mswehli Yes. I think it will take some days until I have time to test it again.
@mswehli I have created a new flutter-project and have added the dependency and your main.dart file. Furthermore I have also added the config.json file. Attached you a test project where the MSAS is within but with the error above. Maybe I have missed something to get this working.
@michaelmairegger think i've found the issue, it seems that kotlin 1.3.50 and 1.3.10 are behaving differently in terms of initialization checks. Could you goto your android folder, and in build.gradle, change ext.kotlin_version to 1.3.50 and let me know if that works for you.
@michaelmairegger @dwhiteddsoft Ok, on further research, it appears to be a known issue with Kotlin but has since been fixed. Please take a look at https://youtrack.jetbrains.com/issue/KT-21862 for more information, but yeah seems the best thing to do is just update kotlin to 1.3.50. Let me know if that fixes things.