{"action":"created","issue":{"url":"https://api.github.com/repos/alibaba/weex/issues/1072","repository_url":"https://api.github.com/repos/alibaba/weex","labels_url":"https://api.github.com/repos/alibaba/weex/issues/1072/labels{/name}","comments_url":"https://api.github.com/repos/alibaba/weex/issues/1072/comments","events_url":"https://api.github.com/repos/alibaba/weex/issues/1072/events","html_url":"https://github.com/alibaba/weex/issues/1072","id":173356451,"number":1072,"title":"main.js是weex SDK的保留初始化js boundle文件，不可以将自己的APP中的js文件命名为main.js","user":{"login":"Lurkyli","id":9714115,"avatar_url":"https://avatars.githubusercontent.com/u/9714115?v=3","gravatar_id":"","url":"https://api.github.com/users/Lurkyli","html_url":"https://github.com/Lurkyli","followers_url":"https://api.github.com/users/Lurkyli/followers","following_url":"https://api.github.com/users/Lurkyli/following{/other_user}","gists_url":"https://api.github.com/users/Lurkyli/gists{/gist_id}","starred_url":"https://api.github.com/users/Lurkyli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lurkyli/subscriptions","organizations_url":"https://api.github.com/users/Lurkyli/orgs","repos_url":"https://api.github.com/users/Lurkyli/repos","events_url":"https://api.github.com/users/Lurkyli/events{/privacy}","received_events_url":"https://api.github.com/users/Lurkyli/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"lvscar","id":1578838,"avatar_url":"https://avatars.githubusercontent.com/u/1578838?v=3","gravatar_id":"","url":"https://api.github.com/users/lvscar","html_url":"https://github.com/lvscar","followers_url":"https://api.github.com/users/lvscar/followers","following_url":"https://api.github.com/users/lvscar/following{/other_user}","gists_url":"https://api.github.com/users/lvscar/gists{/gist_id}","starred_url":"https://api.github.com/users/lvscar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvscar/subscriptions","organizations_url":"https://api.github.com/users/lvscar/orgs","repos_url":"https://api.github.com/users/lvscar/repos","events_url":"https://api.github.com/users/lvscar/events{/privacy}","received_events_url":"https://api.github.com/users/lvscar/received_events","type":"User","site_admin":false},"assignees":[{"login":"lvscar","id":1578838,"avatar_url":"https://avatars.githubusercontent.com/u/1578838?v=3","gravatar_id":"","url":"https://api.github.com/users/lvscar","html_url":"https://github.com/lvscar","followers_url":"https://api.github.com/users/lvscar/followers","following_url":"https://api.github.com/users/lvscar/following{/other_user}","gists_url":"https://api.github.com/users/lvscar/gists{/gist_id}","starred_url":"https://api.github.com/users/lvscar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvscar/subscriptions","organizations_url":"https://api.github.com/users/lvscar/orgs","repos_url":"https://api.github.com/users/lvscar/repos","events_url":"https://api.github.com/users/lvscar/events{/privacy}","received_events_url":"https://api.github.com/users/lvscar/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-08-26T02:36:21Z","updated_at":"2016-10-28T08:00:50Z","closed_at":"2016-10-28T08:00:50Z","body":"我在创建自己的weex APP工程时，将js boundle文件命名为main.js，结果每次启动报错如下：\r\n08-26 10:22:12.940 10908-10996/cn.com E/jsengine:  ReportException :(weex):47: ReferenceError: __weex_define__ is not defined\r\n08-26 10:22:12.944 10908-10996/cn.com E/jsengine:  ReportException : ReferenceError: __weex_define__ is not defined\r\n                                                                   at Object.<anonymous> ((weex):47:3)\r\n                                                                   at __webpack_require__ ((weex):20:30)\r\n                                                                   at (weex):40:18\r\n                                                                   at (weex):43:10\r\n08-26 10:22:13.012 10908-10908/cn.com I/HwCust: Constructor found for class android.app.HwCustHwWallpaperManagerImpl\r\n                                                             \r\n                                                             [ 08-26 10:22:13.179  2930: 2930 E/         ]\r\n                                                             process stopped due to unexpected signal 13\r\n08-26 10:22:13.228 10908-11007/cn.com E/HAL: load: id=gralloc != hmi->id=gralloc\r\n08-26 10:22:13.229 10908-11007/cn.com I/OpenGLRenderer: Initialized EGL, version 1.4\r\n08-26 10:22:14.985 10908-10908/cn.com E/WXTBUtil: isSupportSmartBar:false\r\n08-26 10:22:19.965 10908-10996/cn.com E/weex: reportJSException >>>> instanceId:null, exception function:, exception:ReferenceError: __weex_define__ is not defined\r\n08-26 10:22:19.971 10908-10996/cn.com E/weex: [WXBridgeManager] invokeInitFramework java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Object.hashCode()' on a null object reference\r\n                                                               at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:772)\r\n                                                               at com.taobao.weex.ui.WXRenderManager.getWXSDKInstance(WXRenderManager.java:251)\r\n                                                               at com.taobao.weex.WXSDKManager.getSDKInstance(WXSDKManager.java:217)\r\n                                                               at com.taobao.weex.bridge.WXBridgeManager.reportJSException(WXBridgeManager.java:1093)\r\n                                                               at com.taobao.weex.bridge.WXBridge.reportJSException(WXBridge.java:267)\r\n                                                               at com.taobao.weex.bridge.WXBridge.initFramework(Native Method)\r\n                                                               at com.taobao.weex.bridge.WXBridgeManager.initFramework(WXBridgeManager.java:904)\r\n                                                               at com.taobao.weex.bridge.WXBridgeManager.invokeInitFramework(WXBridgeManager.java:886)\r\n                                                               at com.taobao.weex.bridge.WXBridgeManager.handleMessage(WXBridgeManager.java:822)\r\n                                                               at android.os.Handler.dispatchMessage(Handler.java:98)\r\n                                                               at android.os.Looper.loop(Looper.java:150)\r\n                                                               at android.os.HandlerThread.run(HandlerThread.java:61)\r\n08-26 10:22:19.981 10908-10996/cn.com E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.\r\n08-26 10:22:19.982 10908-10996/cn.com E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.\r\n08-26 10:22:19.983 10908-10996/cn.com E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.\r\n08-26 10:22:19.983 10908-10996/cn.com E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.\r\n08-26 10:22:19.984 10908-10996/cn.com E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.\r\n08-26 10:22:19.984 10908-10996/cn.com E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.\r\n08-26 10:22:19.985 10908-10996/cn.com E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.\r\n\r\n\r\n原因是：\r\nweex sdk的WXBridgeManager::WXBridgeManager中的出事化代码用到了main.js：\r\n      if (TextUtils.isEmpty(framework)) {\r\n        if (WXEnvironment.isApkDebugable()) {\r\n          WXLogUtils.d(\"weex JS framework from assets\");\r\n        }\r\n        framework = WXFileUtils.loadAsset(\"main.js\", WXEnvironment.getApplication());\r\n      }\r\nAPP中新创建的main.js与SDK中的main.js冲突，导致SDK中的main.js被APP中的main.js覆盖，致使WXBridgeManager无法初始化。\r\n\r\n\r\n解决方案：\r\nAPP中开发的js文件，名称不能与weex SDK中使用的js boundle文件重名。\r\n\r\n\r\n建议：\r\nweex公布sdk中保留的js boundle文件名称，避免因js文件重名导致程序BUG。"},"comment":{"url":"https://api.github.com/repos/alibaba/weex/issues/comments/256860228","html_url":"https://github.com/alibaba/weex/issues/1072#issuecomment-256860228","issue_url":"https://api.github.com/repos/alibaba/weex/issues/1072","id":256860228,"user":{"login":"lvscar","id":1578838,"avatar_url":"https://avatars.githubusercontent.com/u/1578838?v=3","gravatar_id":"","url":"https://api.github.com/users/lvscar","html_url":"https://github.com/lvscar","followers_url":"https://api.github.com/users/lvscar/followers","following_url":"https://api.github.com/users/lvscar/following{/other_user}","gists_url":"https://api.github.com/users/lvscar/gists{/gist_id}","starred_url":"https://api.github.com/users/lvscar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvscar/subscriptions","organizations_url":"https://api.github.com/users/lvscar/orgs","repos_url":"https://api.github.com/users/lvscar/repos","events_url":"https://api.github.com/users/lvscar/events{/privacy}","received_events_url":"https://api.github.com/users/lvscar/received_events","type":"User","site_admin":false},"created_at":"2016-10-28T08:00:50Z","updated_at":"2016-10-28T08:00:50Z","body":"Latest version of weex-toolkit(0.5.10)  have renamed weex entry file and  have updated webpack configuration which are generated by weex init.  No more main.we and main.js now.\r\n\r\nPlease install weex-toolkit and use  'weex init' to create project template."}}
{"actor":{"display_login":"lvscar"}}