# "Not Found" error in auth0 react on Android

**URL:** <https://community.auth0.com/t/not-found-error-in-auth0-react-on-android/124850>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [January 15, 2024, 6:26pm UTC](https://community.auth0.com/t/not-found-error-in-auth0-react-on-android/124850 "2024-01-15T18:26:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luca.berhard](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@luca.berhard](https://community.auth0.com/u/luca.berhard)\
**Post date:** [January 15, 2024, 6:26pm UTC](https://community.auth0.com/t/not-found-error-in-auth0-react-on-android/124850/1 "2024-01-15T18:26:02Z")

</div>

Hello,

we have followed the [Ionic & Capacitor Auth0 (React)](https://auth0.com/docs/quickstart/native/ionic-react/01-login) example and ran into the following Issue:

On IOS it works fine but on Android there is a “Not Found” Error on the top left corner of the screen.

I have found this Topic here: ['Not found' error on callback URL in Android app](https://community.auth0.com/t/not-found-error-on-callback-url-in-android-app/112149)

But we do not have the “withScheme” option in auth0 react sdk

We have a callback url that is passed as the redirect\_uri to the login like this:

```ts
  static urlScheme = Capacitor.getPlatform() == "android" ? "http" : "onevcard";

  // Use domain in string interpolation below so that it doesn't
  // get replaced by the quickstart auto-packager
  static authDomain = this.DOMAIN;
  static iosOrAndroid =
    Capacitor.getPlatform() == "ios" || Capacitor.getPlatform() == "android";

  public static CALLBACK_URI = this.iosOrAndroid
    ? `${this.urlScheme}://${this.authDomain}/capacitor/${this.APP_ID}/callback`
    : `${process.env.WEBSITE_URL}`;

```

When finishing the login we get redirected onto this but it seems to not be working.

We have wrapped our index in the `Auth0Provider` in which we pass the `redirect_uri` in the `authorizationParams`

We have registered the callback url in the allowed callbacks in auth0 but this did not change anything

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [January 17, 2024, 1:47am UTC](https://community.auth0.com/t/not-found-error-in-auth0-react-on-android/124850/3 "2024-01-17T01:47:26Z")

</div>

Hey there @luca.berhard welcome to the community!

> [@luca.berhard](#):
>
> On IOS it works fine but on Android there is a “Not Found” Error on the top left corner of the screen.

Just to be clear, do you receive this error when following the sample instructions directly and simply using the pre-configured `appId` (`com.auth0.samples`) in [auth.config.ts](https://github.com/auth0-samples/auth0-ionic-samples/blob/main/react/src/auth.config.ts.example)?

I’m currently unable to reproduce the issue you’re seeing in the sample referenced above. I’ve run into this issue (which is resolved with the android scheme) using the Auth0 Android SDK directly, but I can’t say I’ve seen this in an Ionic/Capactior/React app:

> [@WebAuthProvider.login(account) throws "Not Found." only on Samsung S20 (Android 12)](https://community.auth0.com/t/webauthprovider-login-account-throws-not-found-only-on-samsung-s20-android-12/83681):
>
> Please include the following information in your post: Which SDK this is regarding: Android auth0 SDK SDK Version: 2.7.0 Platform Version: Android 12 (API levels 31, 32) Code Snippets/Error Messages/Supporting Details/Screenshots: When calling WebAuthProvider.login(account) the login form appears correctly and after enterring my login information and proceeding, the page shows “Not found.” at the top left corner and it does not return to the app. This scenario happens only on my Samsung S20 …

---

<div class="post-metadata">

**Author:** ![luca.berhard](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@luca.berhard](https://community.auth0.com/u/luca.berhard)\
**Post date:** [January 17, 2024, 9:36am UTC](https://community.auth0.com/t/not-found-error-in-auth0-react-on-android/124850/4 "2024-01-17T09:36:31Z")

</div>

Hello,

we have been able to resolve the Issue like this:

```auto
  static APP_ID = "com.onevcard.app";
  // set url scheme to http if platform is android, otherwise use "onevcard"
  static urlScheme = Capacitor.getPlatform() == "android" ? "http" : "onevcard";

  // Use domain in string interpolation below so that it doesn't
  // get replaced by the quickstart auto-packager
  static authDomain = this.DOMAIN;

  static isAndroid = Capacitor.getPlatform() == "android";
  static isIOS = Capacitor.getPlatform() == "ios";

  public static CALLBACK_URI = this.isAndroid ? `${this.APP_ID}://callback` : this.isIOS ? `${this.urlScheme}://${this.authDomain}/capacitor/${this.APP_ID}/callback` : `${process.env.WEBSITE_URL}`;

```

also registering the custom url scheme in the string.xml:

```xml
<?xml version='1.0' encoding='utf-8'?>
<resources>
    <string name="custom_url_scheme">com.onevcard.app</string>
</resources>

```

and in the AndroidManifest.xml:

```ts
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="@string/custom_url_scheme" />
            </intent-filter>

```

with this the Browser Plugin could be used and no “Not Found” error was there anymore.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [January 17, 2024, 4:26pm UTC](https://community.auth0.com/t/not-found-error-in-auth0-react-on-android/124850/5 "2024-01-17T16:26:29Z")

</div>

That’s great! Thanks for sharing with the community 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 31, 2024, 4:27pm UTC](https://community.auth0.com/t/not-found-error-in-auth0-react-on-android/124850/6 "2024-01-31T16:27:15Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
