Community
cancel
Showing results for 
Search instead for 
Did you mean: 
SithLord
New Contributor I
2,962 Views

[ERROR] Error initializing Intel XDK Cache:JSON error

[ERROR] Error initializing Intel XDK Cache:JSON error

I received this error on two different occasion upon launching my app after updating it on a physical device.

This error occurred on a Samsung Galaxy S4

I use AFUI 2.2 & XDK 1995

Tags (2)
0 Kudos
10 Replies
PaulF_IntelCorp
Employee
2,962 Views

You're seeing this error in the console of a real device or in the console of the Emulate tab? Or are you using the Debug tab? Please provide more details and an image, if possible.

SithLord
New Contributor I
2,962 Views

Paul Fischer (Intel) wrote:

You're seeing this error in the console of a real device or in the console of the Emulate tab? Or are you using the Debug tab? Please provide more details and an image, if possible.

 

It was a popup message upon launching the app on a real device and not a console msg. 

I was NOT using app preview but the only place i could locate the possible source of the msg is in "cache.js" in the XDK install folder under ..\middleware\cordova\intel-app-preview\...

    channel.onCordovaReady.subscribe(function () {
        me.getInfo(function (info) {
            me.cookies = info.cookies;
            me.mediacache = info.mediacache;
            me.mediacache_dir = info.mediacache_dir;
            channel.IntelXDKCache.fire();
        }, function (e) {
            utils.alert("[ERROR] Error initializing Intel XDK Cache: " + e);
        });
    });

If/when it happens again i will post a screen shot.

 

SithLord
New Contributor I
2,962 Views

XDK 2611 & on real hardware Samsung Galaxy S4 & also a Note 5

Is there is a fix for this error, this started when i did a build today. Its been a while since this last occurred.

	[ERROR] Error initializing Intel XDK Cache:JSON error

 

This error occurred after hitting ok on the popup 'cache json' error above.

assets.png

PaulF_IntelCorp
Employee
2,962 Views

Have no idea what this might be, sorry. Can you put together a small sample app that duplicates the issue and post it here.

SithLord
New Contributor I
2,962 Views

 

<preference name="LoadUrlTimeoutValue" value="30000"/>

After some searching i found and tried changing the value of "LoadUrlTimeoutValue" and if fixed the "connection to the server was unsuccessful" msg problem on my Samsung Galaxy S4 & also the Note 5. The msg "[ERROR] Error initializing Intel XDK Cache:JSON error" remained but only on the Note 5. I tried the app as a crosswalk build and the "xdk cache" msg did not pop up after installation on the Note 5.  I'll release the app as crosswalk and worry about the underlying cause of these issues later.

http://stackoverflow.com/questions/12319809/application-error-the-connection-to-the-server-was-unsuc...

Paul_C_6
Beginner
2,962 Views

Rather than start a new thread...

I receive this error occasionally when opening my app on a real Android device. It is very infrequent but happens occasionally.

[ERROR] Error initializing Intel XDK Cache:JSON error

I have changed <preference name="LoadUrlTimeoutValue" value="30000"/> to 70000 but I still get the error... Does anyone have any ideas what may be happening... or what other info would I need to post to enable someone to have an idea to sole this?

Best regards

Paul

PaulF_IntelCorp
Employee
2,962 Views

Paul -- if you build a "debuggable" equal "true" version of your app, and connect it using USB you can debug the built app directly. See this for some details on how to do that > https://software.intel.com/en-us/xdk/docs/intel-xdk-debug-and-test-overview#RemoteChromeDevTools < Then I would suggest using the "Timeline" or "Network" tabs in Chrome DevTools to see if there's some long startup or delays associated with your app. My guess is something is happening during the startup of your app that is causing long delays. For example, attempting to download some scripts, images, fonts or other assets as part of the application load cycle. In general, you should avoid any such activities as part of the app init and load, as they are unreliable and unpredictable. They should only be done once the app is up and running AND you know you have a good network connection.

Paul_C_6
Beginner
2,962 Views

Thanks for the advice Paul.

I have the debugging up and running on Chrome and can see the Network and Timeline... What would be the tell tale signs which i should be looking out for?

Your help is appreciated.

Paul

PaulF_IntelCorp
Employee
2,962 Views

SithLord
New Contributor I
2,962 Views

 

Some more info on this issue.

After releasing an update to the app store an end user reported this error would pop up most every time he launched the app, my app had not encountered this error since i went with crosswalk builds.

Turns out I had accidentally deployed the app still containing the debug WEINRE script tag.

I decided to bite the bullet and solve the problem once and for all by removing the deprecated plugin intel.xdk.cache, i was using it just for the cookies functionality.

I encountered the error during a live debug session and was able to definitively trace it to cache.js file of this plugin.

https://github.com/01org/cordova-plugin-intel-xdk-cache/blob/master/www/cache.js

 

 

Reply