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 Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

1 answer

Sort by: Most helpful
  1. James Hamil 27,216 Reputation points Microsoft Employee Moderator
    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


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.