基于2.1.1-beta.1开发的游戏打包FB版本在安卓5.0手机上报错

错误信息是“i[l].uniforms.find is not a function”,6.0手机和电脑上没有该错误

备注:用到了SPINE 和 粒子。
之前2.1.1-alpha.3 打包是可以跑的,当时不能用spine。

看起来像是没有 Array.prototype.find 这个方法,你测试一下下面的代码试试

var arr = [11,22,33];
arr.find(function (a) {
  return a === 22;
})

出现了新的错误 “arr.find is not a function”

那你先在项目里加上 polyfill 吧,后面引擎会补上:

Array.prototype.find = function (callback) {
    var list = Object(this);
    // Make sure length is always an positive integer.
    var length = list.length >>> 0;
    var thisArg = arguments[1];
    for (var i = 0; i < length; i++) {
        var element = list[i];
        if (callback.call(thisArg, element, i, list)) {
            return element;
        }
    }

    return undefined;
};

新的错误又来了
TypeError: Cannot set property ‘value’ of undefined
at Array.forEach (native)

莫非要把 ES6的Array相关方法全部写一遍…

是 ES2015 的,想不到竟然还要照顾到这么老的系统

修复代码已提交:
https://github.com/cocos-creator/engine/pull/4096

2.0.10 在安卓5.0 上 数组不支持 for in 循环

要怎么改,整个项目的for in 循环都改吗?还是有什么简单的方法