zoukankan      html  css  js  c++  java
  • 在安卓下打包cocos2d-js 3.6项目with ProtoBuf.js

    项目用到了cocos2d-js 3.6和ProtoBuf.js,但是打包成apk时运行时总是报错(evaluatedOK == JS_FALSE),没有具体的文件和行号报错信息。

    只能一个一个文件排查,最终终于定位到是ProtoBuf.min.js的问题。iOS和各个浏览器均没有问题,只有安卓的apk有问题,估计是spidermonkey的android版本的问题。

    一般出现(evaluatedOK == JS_FALSE)是js文件的语法有问题,但是检查了一遍也没有发现语法错误。

    没办法,只好把代码格式化后一块一块的排查,安卓的build一次很慢啊= =

    最后定位到语法错误的地方为判断Node.js环境的地方:

    Util.IS_NODE = false;
    try
    { // There is no reliable way to detect node.js as an environment, so our // best bet is to feature-detect what we actually need. Util.IS_NODE = typeof require === 'function' && typeof require("fs").readFileSync === 'function' && typeof require("path").resolve === 'function'; } catch (e) {}

    貌似也没有语法错误,不过判断node-js环境也没有什么用,只能把try-catch块都注释了,然后跑就OK了。

  • 相关阅读:
    Spring中的Type学习
    Spring发布监听机制
    BeanFactory父子容器的知识
    Spring中自动创建代理器
    ProxyConfig属性详解
    BeanFactoryAdvisorRetrievalHelper:从Bean工厂检索出Advisor们
    代理机制
    Spring AOP组件
    @Value的使用
    BeanPostProcessor原理--使用讲解
  • 原文地址:https://www.cnblogs.com/engineermind/p/4600457.html
Copyright © 2011-2022 走看看