Expo Android : No Credentials were previously set

I have an expo app that I am trying to use auth0 to log in on android. We have also created the app for iOS and it is able to log in and work. The error I’m getting is like the one in this ticket:
(Can’t include links, so just referencing the name of the other ticket)
no-credentials-were-previously-set-error-with-android-sdk/137419

However, calling hasValidCredentials does not resolve the fact that the credentials aren’t being populated. Here is the code:

  const onLogin = async () => {
    try {
      console.log("authorizing");
      setIsLoading(true);
      await authorize(
        {
          scope: ENV.AUTH0_SCOPE,
          audience: ENV.AUTH0_AUDIENCE,
        },
        {
          useLegacyCallbackUrl: true,
        },
      ).then(() => {
        console.log("authorized");
        auth0_instance.credentialsManager
          .hasValidCredentials()
          .then((hasValidCredentials) => {
            console.log("hasValidCredentials", hasValidCredentials);
          })
          .catch((err) => {
            console.log("hasValidCredentials error", err);
          });
        auth0_instance.credentialsManager
          .getCredentials()
          .then(async (credentials) => {
            console.log("credentials", credentials);
          })
          .catch((err) => {
            console.log("credentials error", err);
          });
      });
    } catch (err) {
      showAlert(err);
    } finally {
      setIsLoading(false);
    }
  };


When this runs: the following debug output occurs:

 LOG  authorizing
 LOG  authorized
 LOG  hasValidCredentials false
 LOG  credentials error [Error: No Credentials were previously set.]

As stated before, iOS works fine, and I believe the callback url info is set properly because if I legimitately make the the domain or schema wrong, there is an error when the login experience appears immediately.

Any assistance is appreciated.

Hi @dmcgaughey,

Welcome to the Auth0 Community.

Can you provide more details about the android specific settings and the iOS ones inside your project?

Have a good one,
Vlad

There really aren’t many if any differences, and none (as far as I can tell) that are pertinent to auth0 configuration. The android application id and iOS bundle are even identical so that the format between the two should match.

Here’s the expo app config portion that specifies iOS and android config:

  ios: {
    supportsTablet: true,
    bundleIdentifier: IS_QA ? "qa.ourappname" : "com.ourappname",
    googleServicesFile: IS_QA
      ? "./firebase-config/ourappname/qa/GoogleService-Info.plist"
      : "./firebase-config/ourappname/prod/GoogleService-Info.plist",
    infoPlist: {
      CFBundleDisplayName: IS_QA ? "Our App Name (QA)" : "Our App Name",
    },
    entitlements: {
      "aps-environment": IS_QA ? "development" : "production",
    },
    config: {
      usesNonExemptEncryption: false,
    },
  },
  android: {
    adaptiveIcon: {
      foregroundImage: "./assets/images/adaptive-icon.png",
      backgroundColor: "#ffffff",
    },
    package: IS_QA ? "qa.ourappname" : "com.ourappname",
    googleServicesFile: IS_QA
      ? "./firebase-config/ourappname/qa/google-services.json"
      : "./firebase-config/ourappname/prod/google-services.json",
  },

@vlad.murarasu Does the above provide the info you’re looking for? Its been a few days without a response.

Hi @dmcgaughey,

Sorry for the wait. After looking more into it, unfortunately it looks like this issue is outside the scope of the community support.

This github readme chapter might provide some useful information.

But if it still doesn’t help, our recommendation is to open up a support ticket.

If you have any other questions feel free to ask us.

Have a good one,
Vlad