MSALException java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference in android native app

Grover, Sidhartha 1 Reputation point
2021-04-19T17:38:43.437+00:00

I'm trying to use MSAL android library to implement Azure AD B2C authentication in our enterprise android native app. After generating the appropriate configuration and using it in the azure samples (Botth Java and Kotlin) I get the error

java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference

On checking the network logs it appears that the authentication response is missing the access_token. On searching the web I found this open issue on github that has a workaround/ instructions to get past this error but that didnt help.

I would really like to get this working.

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
12,635 questions
Azure Active Directory External Identities
{count} votes

1 answer

Sort by: Most helpful
  1. James Hamil 11,796 Reputation points Microsoft Employee
    2021-04-20T21:18:23.043+00:00

    Hi @Grover, Sidhartha , I think the best bet is to open a support ticket so we can look at your code and environment. I can get you a free ticket if you email "azcommunity@microsoft.com" with subject "ATTN: James Hamil" and attach your subscription ID. Please let me know when you have done so.

    Best,
    James