microsoft-authentication-library-for-android icon indicating copy to clipboard operation
microsoft-authentication-library-for-android copied to clipboard

Fatal Exception: java.lang.NullPointerException: uriString

Open Javs-21 opened this issue 1 year ago • 2 comments

Describe the bug we are having some crashes reported in crashlytics, it's happening in the version 4.7.0

Smartphone (please complete the following information):

  • Device: Samsung A32
  • Android Version: 13
  • Browser [e.g. Chrome, Edge]
  • MSAL Version: 4.7.0

Stacktrace Fatal Exception: java.lang.NullPointerException: uriString at android.net.Uri$StringUri.(Uri.java:504) at android.net.Uri$StringUri.() at android.net.Uri.parse(Uri.java:466) at com.microsoft.identity.client.PublicClientApplicationConfiguration.validateCustomTabRedirectActivity(PublicClientApplicationConfiguration.java:630) at com.microsoft.identity.client.PublicClientApplicationConfiguration.checkIntentFilterAddedToAppManifestForBrokerFlow(PublicClientApplicationConfiguration.java:676) at com.microsoft.identity.client.PublicClientApplication.initializeApplication(PublicClientApplication.java:1078) at com.microsoft.identity.client.PublicClientApplication.(PublicClientApplication.java:1062) at com.microsoft.identity.client.MultipleAccountPublicClientApplication.(MultipleAccountPublicClientApplication.java:67) at com.microsoft.identity.client.PublicClientApplication$9.onTaskCompleted(PublicClientApplication.java:944) at com.microsoft.identity.client.PublicClientApplication$9.onTaskCompleted(PublicClientApplication.java:930) at com.microsoft.identity.common.java.controllers.CommandDispatcher.commandCallbackOnTaskCompleted(CommandDispatcher.java:649) at com.microsoft.identity.common.java.controllers.CommandDispatcher.access$1000(CommandDispatcher.java:99) at com.microsoft.identity.common.java.controllers.CommandDispatcher$4.run(CommandDispatcher.java:625) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:224) at android.os.Looper.loop(Looper.java:318) at android.app.ActivityThread.main(ActivityThread.java:8772) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:561) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)

Expected behavior show the login or no get any crash

Actual Behavior suddenly get a crash

Javs-21 avatar May 30 '24 16:05 Javs-21

++ I experienced the same situation. One user encountered 27 crashes. Does anyone have a solution or information?

oguncan avatar Jun 06 '24 07:06 oguncan

I already update the version from 4.7.0 to 5.3.1 and I am still having the issue, looking in internet I watched this Issue that you solved in past, in my case I am passing a configFile, because I can have different logins, so I am using this method

`public static void createMultipleAccountPublicClientApplication(@NonNull final Context context, @NonNull final File configFile, @NonNull final IMultipleAccountApplicationCreatedListener listener) {

    validateNonNullArgument(context, NONNULL_CONSTANTS.CONTEXT);
    validateNonNullArgument(listener, NONNULL_CONSTANTS.LISTENER);

    runOnBackground(new Runnable() {
        @Override
        public void run() {
            createMultipleAccountPublicClientApplication(
                    initializeConfiguration(context, configFile),
                    listener
            );
        }
    });
}`

Javs-21 avatar Jun 10 '24 16:06 Javs-21

@Javs-21 Can you please try to check the config file? Please make sure that is is correctly formatted and includes all necessary fields, particularly the redirectUri.

negoe avatar Jul 09 '24 19:07 negoe

@negoe yes is correct, we are pasign the correct values, we can show the webview with the login but for some reason some users get that crash, the last one was yesterday this image in my QA environment Captura de pantalla 2024-07-09 a la(s) 4 55 36 p m

this one is in my PROD environment

Captura de pantalla 2024-07-09 a la(s) 4 56 39 p m

@negoe please don't ignore me

Javs-21 avatar Jul 10 '24 00:07 Javs-21

@Javs-21 Can you please share your config file so that we can try reproducing the issue on our side?

negoe avatar Jul 10 '24 17:07 negoe

@Javs-21 Can you please share your config file so that we can try reproducing the issue on our side?

Can you explain why I still get this crash if I provide the config file information?

oguncan avatar Apr 30 '25 13:04 oguncan