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.

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,633 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,422 questions
{count} votes

1 answer

Sort by: Most helpful
  1. James Hamil 21,546 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