I'm getting the following error when running my hyrbrid-remote app in the Android Emulator. Everything works fine in iOS. All of my resources are static resources in SF.
07-24 09:53:51.017: I/chromium(4474): [INFO:CONSOLE(0)] "XMLHttpRequest cannot load https://cs10.salesforce.com/!gap_exec?1406210030920.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'https://c.cs10.visual.force.com' is therefore not allowed access.",
source: https://c.cs10.visual.force.com/apex/MobileLanding (0)
Any suggestions?
Also, if its helpful I'm using SmartStore as well.
EDIT:
I found this in /Smartstore/res/xml/config.xml could this be part of the issue?
<access origin="http://127.0.0.1*"/> <!-- allow local pages -->
<access origin="https://force.com" subdomains="true" />
<access origin="https://salesforce.com" subdomains="true" />
EDIT 2:
I found this line inside the cordova.js
file which I believe is the static resource that causes the error. This gap_exec
is what the the error is complaining about.
execXhr.open('HEAD', "/!gap_exec?" + (+new Date()), true);
if (!vcHeaderValue) {
vcHeaderValue = /.*\((.*)\)/.exec(navigator.userAgent)[1];
}
execXhr.setRequestHeader('vc', vcHeaderValue);
execXhr.setRequestHeader('rc', ++requestCount);
if (shouldBundleCommandJson()) {
execXhr.setRequestHeader('cmds', iOSExec.nativeFetchMessages());
}
execXhr.send(null);
Access-Control-Allow-Origin
? A similar question in StackOverflow: stackoverflow.com/questions/5008944/…