Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Errors running and even the sample does not run #8

Open
dwhiteddsoft opened this issue Dec 17, 2019 · 8 comments
Open

Errors running and even the sample does not run #8

dwhiteddsoft opened this issue Dec 17, 2019 · 8 comments

Comments

@dwhiteddsoft
Copy link

dwhiteddsoft commented Dec 17, 2019

We noticed our usage of msal_flutter started to fail. As we went back to figure out what was wrong, we simply ran your example app and it errors out in the same way which makes us think it is an environment error. Here is the error when it is run:
D/MsalFlutter( 4843): Got scopes: null
D/MsalFlutter( 4843): Got cleintId: removed by me
D/MsalFlutter( 4843): Got authority: https://owltechindustries.b2clogin.com/tfp/owltechindustries.onmicrosoft.com/B2C_1_signin_signup
D/MsalFlutter( 4843): Authority not null
D/MsalFlutter( 4843): Creating with: removed by me - https://owltechindustries.b2clogin.com/tfp/owltechindustries.onmicrosoft.com/B2C_1_signin_signup
D/MsalFlutter( 4843): Getting the created listener
E/AndroidRuntime( 4843): FATAL EXCEPTION: pool-4-thread-1
E/AndroidRuntime( 4843): Process: uk.co.moodio.msal_flutter_example, PID: 4843
E/AndroidRuntime( 4843): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference
E/AndroidRuntime( 4843): at com.microsoft.identity.common.internal.request.OperationParameters.hashCode(OperationParameters.java:252)
E/AndroidRuntime( 4843): at com.microsoft.identity.common.internal.controllers.BaseCommand.hashCode(BaseCommand.java:123)
E/AndroidRuntime( 4843): at java.util.HashMap.hash(HashMap.java:338)
E/AndroidRuntime( 4843): at java.util.LinkedHashMap.get(LinkedHashMap.java:464)
E/AndroidRuntime( 4843): at android.util.LruCache.get(LruCache.java:117)
E/AndroidRuntime( 4843): at com.microsoft.identity.common.internal.controllers.CommandResultCache.get(CommandResultCache.java:48)
E/AndroidRuntime( 4843): at com.microsoft.identity.common.internal.controllers.CommandDispatcher$1.run(CommandDispatcher.java:90)
E/AndroidRuntime( 4843): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
E/AndroidRuntime( 4843): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
E/AndroidRuntime( 4843): at java.lang.Thread.run(Thread.java:764)

Environment looks like:
Flutter: Flutter (Channel stable, v1.9.1+hotfix.4, on Mac OS X 10.15.1 19B88, locale en-US)
Dart version 2.5.0
Android Studio 3.5.3
Flutter plugin version 42.1.1
Dart plugin version 191.8593
Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
ext.kotlin_version = '1.3.50' (in. build.gradle)

Any thoughts appreciated as we are a little surprise it suddenly stopped working

@ericgkr
Copy link
Contributor

ericgkr commented Dec 18, 2019

I believe it's due to com.microsoft.identity.client:msal upgrade, because after change the line below in build.gradle
implementation 'com.microsoft.identity.client:msal:1.0.+'
to
implementation 'com.microsoft.identity.client:msal:1.0.0'

the example app works again.

However i am not sure how to fix it in msal-flutter yet. But as a temporary solution, you can force the version number in android/build.gradle of your project. Example:

allprojects {
configurations.all {
resolutionStrategy.force "com.microsoft.identity.client:msal:1.0.0"
}
}

@mswehli
Copy link
Member

mswehli commented Dec 24, 2019

Sorry about that and the delay in replying had been a bit swamped, but I'll test it this week to see what the issue might be, and will attempt to specify the exact msal version to see if that helps.

@iron9light
Copy link

I guess it's because it's not compatible with msal 1.0.1.
And I've tried to change msal version to 1.1.0, not work.

@mswehli
Copy link
Member

mswehli commented Jan 7, 2020

Sorry for the delay in replying, been a very busy winter period.
yes, as @erikgkr found (thanks for that by the way, doubt i would have found that on my own! :) ), it seems to be something with the change from 1.0.0 to the newer versions. I've update the package now to force it to only use 1.0.0, as to be honest it was a mistake on my part not to have specified it exactly anyway. >_<
I've published the changes, but please have a look and let me know if it fixes it for you. The new package version is 1.0.0+3 and should fix the android issues. Tested it locally and worked for me.

Oh, just please make sure to use kotlin version 1.3.30 or later, especially if you get the error "java.lang.NoSuchFieldError: No static field msalApp of type Lcom/microsoft/identity/client/IMultipleAccountPublic"

@ericgkr
Copy link
Contributor

ericgkr commented Jan 10, 2020

@mswehli i confirm that with 1.0.0+3 no need to enforce com.microsoft.identity.client:msal version in android/build.gradle any more. Many thanks!

@Lampat
Copy link

Lampat commented Oct 16, 2020

It is still not working for me..

D/MsalFlutter(15705): Got scopes: null D/MsalFlutter(15705): Got cleintId: <it is displayed, i removed it from here> D/MsalFlutter(15705): Got authority: https://<removed by me>.b2clogin.com/tfp/<removed by me>.onmicrosoft.com/B2C_1_FLUTTER D/MsalFlutter(15705): Authority not null D/MsalFlutter(15705): Creating with: <removed by me> - https://<removed by me>.b2clogin.com/tfp/<removed by me>.onmicrosoft.com/B2C_1_FLUTTER D/MsalFlutter(15705): Getting the created listener W/pgrade.frontbo(15705): Accessing hidden field Lsun/misc/Unsafe;->theUnsafe:Lsun/misc/Unsafe; (light greylist, reflection) E/AndroidRuntime(15705): FATAL EXCEPTION: pool-20-thread-1 E/AndroidRuntime(15705): Process: gr.upgrade.frontbox, PID: 15705 E/AndroidRuntime(15705): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference E/AndroidRuntime(15705): at com.microsoft.identity.common.internal.request.OperationParameters.hashCode(OperationParameters.java:252) E/AndroidRuntime(15705): at com.microsoft.identity.common.internal.controllers.BaseCommand.hashCode(BaseCommand.java:123) E/AndroidRuntime(15705): at java.util.HashMap.hash(HashMap.java:338) E/AndroidRuntime(15705): at java.util.LinkedHashMap.get(LinkedHashMap.java:464) E/AndroidRuntime(15705): at android.util.LruCache.get(LruCache.java:117) E/AndroidRuntime(15705): at com.microsoft.identity.common.internal.controllers.CommandResultCache.get(CommandResultCache.java:48) E/AndroidRuntime(15705): at com.microsoft.identity.common.internal.controllers.CommandDispatcher$1.run(CommandDispatcher.java:90) E/AndroidRuntime(15705): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/AndroidRuntime(15705): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/AndroidRuntime(15705): at java.lang.Thread.run(Thread.java:764) D/NetworkSecurityConfig(15705): No Network Security Config specified, using platform default I/DpmTcmClient(15705): RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor D/TransportRuntime.SQLiteEventStore(15705): Storing event with priority=HIGHEST, name=FIREBASE_CRASHLYTICS_REPORT for destination cct D/TransportRuntime.JobInfoScheduler(15705): Scheduling upload for context TransportContext(cct, HIGHEST, MSRodHRwczovL2NyYXNobHl0aWNzcmVwb3J0cy1wYS5nb29nbGVhcGlzLmNvbS92MS9maXJlbG9nL2xlZ2FjeS9iYXRjaGxvZ1xBSXphU3lCcnBTWVQ0RkZMMDlyZUhKaTZIOUZZZGVpU25VVE92Mk0=) with jobId=-1090506343 in 1000ms(Backend next call timestamp 1602838224914). Attempt 1 I/Process (15705): Sending signal. PID: 15705 SIG: 9 Lost connection to device. Exited (sigterm)

I followed all the steps you say to do for android set up in the package readme.

I use the latest version of the package : msal_flutter: ^1.0.0+3

And if I add in the appname > android>app>build.gradle the following as suggested above:
implementation 'com.microsoft.identity.client:msal:1.5.+'
or implementation 'com.microsoft.identity.client:msal:1.0.0'
The app takes forever to build and doesn't in the end build throwing the following error:

`FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not find com.microsoft.device.display:display-mask:0.3.0.
Required by:
project :app > com.microsoft.identity:common:2.0.12-hf1

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 15s
Exception: Gradle task assembleDebug failed with exit code 1
`

@Lampat
Copy link

Lampat commented Oct 16, 2020

I also tried to clone the project and run the example app, still gives the same error as explained above.

@santiagosw
Copy link

Some update on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants