question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MSAL auth - Android - Release - crash after splashscreen

See original GitHub issue

Description

Hello,

I followed https://learn.microsoft.com/en-us/azure/developer/mobile-apps/azure-mobile-apps/quickstarts/maui/authentication

It works well in Debug on each platform.

But on Android, it crashes after splashscreen in Release mode. It works well in Debug.

Maybe there is a permission to add but it’s not in the documentation so I don’t know.

Will provide a repro project tomorrow morning

Steps to Reproduce

Add a new activity with

[Activity(Exported = true)]
[IntentFilter(new[] { Intent.ActionView },
    Categories = new[] { Intent.CategoryBrowsable, Intent.CategoryDefault },
    DataHost = "auth",
    DataScheme = "msal{CANNOT_SHARE_MY_ID_HERE")]
public class MsalActivity : BrowserTabActivity
{
}

and in MainActivity, add

protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data)
{
    base.OnActivityResult(requestCode, resultCode, data);
    // Return control to MSAL
    AuthenticationContinuationHelper.SetAuthenticationContinuationEventArgs(requestCode, resultCode, data);
}

Link to public reproduction project repository

https://github.com/nk54/maui_bug_msal

Version with bug

7.0 Release Candidate 2

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 9 and maybe up

Did you find any workaround?

Archive in Debug instead of Release but the app is so slow… Or remove authentication ? 💥 🙅

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nk54commented, Nov 3, 2022

@rachelkang Visual Studio log console (logcat) SHOULD (must?) have filterable columns : I cannot search error only. It doesn’t help at all. Visual Studio must be the best experience to develop MAUI app. But it doesn’t feel like it is. It’s been years developpers wait for such things.

0reactions
nk54commented, Nov 3, 2022

I’ve created a new issue and closed this one because the title of this thread is misleading.

Read more comments on GitHub >

github_iconTop Results From Across the Web

App crashes using the new Android 12 Splash Screen API
I'm trying to use the new Android 12 Splash Screen API but my app keeps crashing when opening the first activity. I have...
Read more >
MsalClientException "No refresh token was found" #570
Hello, I'm using the com.microsoft.identity.client:msal:0.2.2 version of the MSAL library. Context: My Android App uses an MVVM architecture ...
Read more >
App crashing after splash screen animation on Samsung ...
Sync crashes after the splash screen animation on Galaxy S22 Ultra oneui 5 beta. Is this happening to anyone else?
Read more >
Handle exceptions and errors in MSAL for Android
This exception class represents errors when communicating to the service, can be from the authorize or token endpoints. MSAL reads the error and ......
Read more >
Apk Crash after splash screen - An error ocurred, please ...
When i run the project i can view it correctly in Make it Native app, but when i build and install the apk...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found