原生上面请求http出错

在模拟器 已经 网页上都没问题。
但是在真机上运行就出错了。
Creator 1.8.2
exports.get = function(path){
return new Promise((resolve, reject)=>{
let xhr = cc.loader.getXMLHttpRequest();
xhr.timeout = 5000;

    let url = Global.server + path;
    xhr.open("GET", url, true);
    if (cc.sys.isNative) {
        //xhr.setRequestHeader("Accept-Encoding", "gzip,deflate", "text/html;charset=UTF-8");
    }
    xhr.onload = function() {
        if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304) {
            try{
                let res = JSON.parse(xhr.response);
                resolve(res.data);
            }catch(err){
                reject(err);
            }
        } else {
            reject(xhr.statusText);
        }
    };
    xhr.onerror = function(){
        reject('error ... ');
    }
    xhr.ontimeout = function(){
        reject('time out');
    }
    try{
        xhr.send();
    }catch(err){
        reject('Unknown Error');
    }
})

}

在真机上是获取 XMLHttpRequest 对象时出现错误的。

贴下错误日志。

04-23 19:12:22.181 10676 10692 E jswrapper: ERROR: Uncaught ReferenceError: ActiveXObject is not defined, location: src/jsb_polyfill.js:0:0
04-23 19:12:22.181 10676 10692 E jswrapper: STACK:
04-23 19:12:22.181 10676 10692 E jswrapper: [0]getXMLHttpRequest@src/jsb_polyfill.js:11857
04-23 19:12:22.181 10676 10692 E jswrapper: [1]onLoad@src/project.dev.js:2045
04-23 19:12:22.181 10676 10692 E jswrapper: [2]anonymous@(no filename):3
04-23 19:12:22.181 10676 10692 E jswrapper: [3]invoke@src/jsb_polyfill.js:4605
04-23 19:12:22.181 10676 10692 E jswrapper: [4]activateNode@src/jsb_polyfill.js:13655
04-23 19:12:22.181 10676 10692 E jswrapper: [5]_activate@src/jsb_polyfill.js:3259
04-23 19:12:22.181 10676 10692 E jswrapper: [6]runSceneImmediate@src/jsb_polyfill.js:24777
04-23 19:12:22.181 10676 10692 E jswrapper: [7]anonymous@src/jsb_polyfill.js:24871
04-23 19:12:22.181 10676 10692 E jswrapper: [8]anonymous@src/jsb_polyfill.js:15952
04-23 19:12:22.181 10676 10692 E jswrapper: [9]anonymous@src/jsb_polyfill.js:11941
04-23 19:12:22.181 10676 10692 E jswrapper: [10]anonymous@src/jsb_polyfill.js:19316
04-23 19:12:22.181 10676 10692 E jswrapper: [11]onceWrapper@src/jsb_polyfill.js:11001
04-23 19:12:22.181 10676 10692 E jswrapper: [12]77.EventListeners.invoke@src/jsb_polyfill.js:10846
04-23 19:12:22.181 10676 10692 E jswrapper: [13]78.proto.emit@src/jsb_polyfill.js:11025
04-23 19:12:22.181 10676 10692 E jswrapper: [14]callback@src/jsb_polyfill.js:24911

解决了,原来是 打包时 native network 没有勾选。。。