Pack COCOS2D-JS 3.6 Project with Protobuf.js under Android

Source: Internet
Author: User

The project uses COCOS2D-JS 3.6 and protobuf.js, but when packaged into an APK runtime always error (Evaluatedok = = Js_false), no specific file and line number error messages.

Only one file to troubleshoot, and finally to locate the problem is ProtoBuf.min.js. iOS and individual browsers are no problem, only Android apk has a problem, estimated to be SpiderMonkey Android version of the problem.

The general appearance (Evaluatedok = = Js_false) is the syntax of the JS file is problematic, but the check again did not find grammatical errors.

No way, had to put the code format after a piece of troubleshooting, Android build a very slow AH =

The last place to locate the syntax error is where to judge the node. JS Environment:

Util.is_node = false;
Try { // There is no reliable-to detect node. js as an environment // Best bet was 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) {}

There seems to be no grammatical errors, but Judge Node-js environment is not much use, can only put Try-catch blocks are annotated, and then run OK.

Pack COCOS2D-JS 3.6 Project with Protobuf.js under Android

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.