# CORS issue when testing on Android

**URL:** <https://community.auth0.com/t/cors-issue-when-testing-on-android/80079>\
**Category:** Get Help\
**Tags:** android, cordova, cors\
**Created:** [March 17, 2022, 5:10pm UTC](https://community.auth0.com/t/cors-issue-when-testing-on-android/80079 "2022-03-17T17:10:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![worthy\_admin](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/worthy_admin/32/34442_2.png) [@worthy\_admin](https://community.auth0.com/u/worthy_admin)\
**Post date:** [March 17, 2022, 5:10pm UTC](https://community.auth0.com/t/cors-issue-when-testing-on-android/80079/1 "2022-03-17T17:10:40Z")

</div>

Hello,

I recently updated our cordova plugins, and platform for android to satisfy Google’s Play Store API level 30 requirement.

As I was testing on Android I noticed that I get a CORS issue when hitting the `/oauth/token` endpoint.

The changes we made after changing the target api to 30 is as follows:

updated platform - cordova-android - 10.1.1  
updated plugin - customurlscheme - git+https://github.com/Onegini/cordova-plugin-inappbrowser.git  
added plugin - cordova-plugin-androidx-adapter - 1.1.3

Here is the error I get:

```auto
{
code: null
description: null
name: "Error"
original: "Error: Request has been terminated Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc. at Request.push../node_modules/auth0-js/dist/auth0.min.esm.js.Request.crossDomainError (http://192.168.1.80:8080/vendor.js:20552:63668) at XMLHttpRequest.xhr.onreadystatechange (http://192.168.1.80:8080/vendor.js:20552:65487)"
  crossDomain: true
  method: "POST"
  status: undefined
  url: "https://{OUR_DOMAIN}/oauth/token"
  message: "Request has been terminated Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc."
  stack: "Error: Request has been terminated Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc. at Request.push../node_modules/auth0-js/dist/auth0.min.esm.js.Request.crossDomainError (http://192.168.1.80:8080/vendor.js:20552:63668)↵ at XMLHttpRequest.xhr.onreadystatechange (http://192.168.1.80:8080/vendor.js:20552:65487)"

}

```

We think this is happening to users on our Internal track build when we last deployed

---

<div class="post-metadata">

**Author:** ![worthy\_admin](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/worthy_admin/32/34442_2.png) [@worthy\_admin](https://community.auth0.com/u/worthy_admin)\
**Post date:** [March 18, 2022, 4:05pm UTC](https://community.auth0.com/t/cors-issue-when-testing-on-android/80079/2 "2022-03-18T16:05:00Z")

</div>

We have found a fix In our Config.xml we added these preferences in the platform android tag:

```auto
<preference name="hostname" value="localhost" />
<preference name="AndroidInsecureFileModeEnabled" value="true" />

```

It appears that the CORS issue was related to a local development problem and the issue that our users face was related to an Error Connection problem with the app itself

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 31, 2022, 11:11am UTC](https://community.auth0.com/t/cors-issue-when-testing-on-android/80079/3 "2022-03-31T11:11:10Z")

</div>

Thanks for sharing it with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 31, 2022, 11:11am UTC](https://community.auth0.com/t/cors-issue-when-testing-on-android/80079/4 "2022-03-31T11:11:15Z")

</div>


