Cocos Creator 1.10.0 cannot load JSON on Android

Hi,

first of all, I noticed that the cc.loader.load has been changed from 1.9.x to 1.10.0. I used the following code to load the game data in 1.9.x:

    // Load game data...
    var url = cc.url.raw('resources/gamedata.json');
    cc.loader.load( url, function(err, res) {
        GlobalData.gameData = res;
    });

In 1.10.0 I had to change the assignment as follows:

        GlobalData.gameData = res.json;

It works in the simulator/browser, but the compiled APK does not work on Android. What should I do?

Best regards,
Zsolt

have you tried to do
loader.loadRes(url, cc.JsonAsset, (err, res) => GlobalData.gameData = res) ?

is there anything in err on Android?

Hi,

I tried to use the “old method” to use the res directly, but it did not work. The next step is to log the err on Android. Now I simply insert the game data statically… development cannot stop! :slight_smile:

Thanks for your efforts,
Zsolt

@slackmoehrle Any comment from the developers concerning this topic? Would you be so kind as to contact them?

Can you please try 2.0 and see if the problem persists?

Ok, I will.

Well, there are some problems with CC 2.0, fromHSV generates very strange colors (the r-g-b-a variables are mixed?!) and the compiled APK cannot be installed on the Android devices… I don’t know why.

Best regards,
Zsolt