Software Archive
Read-only legacy content
17061 Обсуждение

Failed to fetch url

Szymon_P_
Новичок
1 475Просмотр.

Hello,

My code is:

intel.xdk.device.getRemoteData(app.url + 'some/url',"POST","some=data","success","error");

It works great in emulate tab, but if I build crosswalk for android or just android it doesnt work.

I've tried export app to chrome and check it console. This is what i get:

Uncaught ReferenceError: intel is not defined

Legacy hybrid mobile app build -> Android make a build with this works, but resolution is too high and I cant see anything except a data is downloaded from external server successfully.

 

EDIT

I've fixed this js error by changing 

$(function(){
myFetchFunc();
});

to:

document.addEventListener("intel.xdk.device.ready",function(){
 myFetchFunc();
},false); 

But fetching data from url is still broken in build. Works great in emulating and usb debug... 

 

0 баллов
1 Решение
Szymon_P_
Новичок
1 475Просмотр.

After few hours of debugging

I have made AWFUL hack but it works

* {
font-size: 50px !important;
}

With legacy android build

This is app only for my own use, so I could do that, because it doesn't look well now.

The same code but builded with crosswalk doesn't work.

Просмотреть решение в исходном сообщении

6 Ответы
Szymon_P_
Новичок
1 476Просмотр.

After few hours of debugging

I have made AWFUL hack but it works

* {
font-size: 50px !important;
}

With legacy android build

This is app only for my own use, so I could do that, because it doesn't look well now.

The same code but builded with crosswalk doesn't work.

Pamela_H_Intel
Модератор
1 475Просмотр.

Szymon,

Perhaps you have not specified a needed plugin for the build (core plugins are automatically included in the emulator and Debug features, but not in builds). See forum thread 561120.

Pamela

PaulF_IntelCorp
Сотрудник
1 475Просмотр.

I'm guessing that you might be getting hit by the white list (domain access) gremlin -- see the white list doc on this page: https://software.intel.com/en-us/xdk/docs/xdk-doc-quick-links

Szymon_P_
Новичок
1 475Просмотр.

Paul Fischer (Intel) wrote:

I'm guessing that you might be getting hit by the white list (domain access) gremlin -- see the white list doc on this page: https://software.intel.com/en-us/xdk/docs/xdk-doc-quick-links

Thanks, I have created new rule:
http://* + external
It didn't work.

 

Pamela_H_Intel
Модератор
1 474Просмотр.

Szymon,

You do want to use the Crosswalk for Android build. Your app does work with Crosswalk - that is what USB debug uses. Perhaps there is an App Version Code issue. Try uninstalling the app from your device and then install the Crosswalk build.

Hamilton_Tenório_da_
Ценный участник I
1 475Просмотр.

If you have included JQuery, you can use something like that:

    $.ajax({
        type: "POST",
        url: "http://xxxxxxxxxxxxxxxxxxxxxxxx",
        data: wpost,
        success: function(retorno) {funFuncao(retorno);},
        dataType: 'json'
    });

 

I used this with Cordova Android/iOS

 

Ответить