2.0.8 命令行构建项目 actualPlatform platform 不一致

  • Creator 版本:2.0.8

  • 目标平台: Web

  • 详细报错信息,包含调用堆栈:
    ===== Initializing Editor =====
    arguments:
    –path
    /Users/wangkun/work/fcool/proj/SuperFlyMan
    –build
    configPath=/Users/wangkun/work/fcool/proj/SuperFlyMan/scripts/build-cfg.json

init QuickCompiler: 2534.834ms
Start to build platform [web-mobile]
[ start [ ] 0% 0.0s ][94419] Start building with options : {
“android-instant”: {
“REMOTE_SERVER_ROOT”: “”,
“host”: “”,
“pathPattern”: “”,
“recordPath”: “”,
“scheme”: “https”,
“skipRecord”: false
},
“encryptJs”: false,
“excludeScenes”: [],
“fb-instant-games”: {},
“includeSDKBox”: false,
“inlineSpriteFrames”: false,
“inlineSpriteFrames_native”: true,
“md5Cache”: true,
“mergeStartScene”: false,
“optimizeHotUpdate”: true,
“orientation”: {
“landscapeLeft”: true,
“landscapeRight”: true,
“portrait”: false,
“upsideDown”: false
},
“qqplay”: {
“REMOTE_SERVER_ROOT”: “”,
“orientation”: “portrait”,
“zip”: false
},
“startScene”: “5a98c03e-7312-45fb-84c6-ec7f4b3ac12f”,
“title”: “SuperFlyMan”,
“webOrientation”: “portrait”,
“wechatgame”: {
“orientation”: “portrait”,
“subContext”: “”
},
“zipCompressJs”: true,
“actualPlatform”: “wechatgame”,
“apiLevel”: “”,
“appABIs”: [],
“buildPath”: “work/nginx/file-server/build/4399",
“debug”: false,
“embedWebDebugger”: false,
“platform”: “web-mobile”,
“previewHeight”: “720”,
“previewWidth”: “1280”,
“sourceMaps”: false,
“template”: “link”,
“useDebugKeystore”: true,
“vsVersion”: “auto”,
“dest”: “work/nginx/file-server/build/4399/wechatgame",
“excludedModules”: [
“ParticleSystem”,
“TiledMap”,
“Spine Skeleton”,
“RichText”,
“MotionStreak”,
“PageView”,
“PageViewIndicator”,
“VideoPlayer”,
“WebView”,
“Physics”,
“StudioComponent”,
“Intersection”
],
“autoCompile”: false,
“configPath”: "/
/scripts/build-cfg.json”,
“scenes”: [
“5a98c03e-7312-45fb-84c6-ec7f4b3ac12f”,
“86d2e2c3-e94c-4a65-8de4-cd256e33cdbb”
],
“project”: "/
”,
“projectName”: “***”,
“debugBuildWorker”: false
}

  • 重现方式:之前使用编辑器的构建面板选中构建过wechatgame 然后使用脚本构建就一直actualPlatform:wechatgame

  • 之前哪个版本是正常的 :

  • 手机型号 :

  • 手机浏览器 :

  • 编辑器操作系统 :mac

  • 编辑器之前是否有其它报错 :

  • 出现概率:100

  • 额外线索:

init QuickCompiler: 2534.834ms
Start to build platform [web-mobile]
“platform”: “web-mobile”,
“actualPlatform”: “wechatgame”,

实际构建出来的wechatgame文件夹中的内容,应该是web的包吧?

还真是,就是说这样的错误不影响吗?

但是现在我要写脚本完成自动的构建上传,这种情况给我多了个webchatgame的路径没法处理啊,

构建出来的内容路径问题可以解决吗? 现在构建出来的路径

“buildPath”: “***work/nginx/file-server/build/4399”,

“dest”: “***work/nginx/file-server/build/4399/wechatgame”,

实际是/build/4399/wechatgame,并不是正常的的4399/web-mobile

已解决,每次构建之前删除local文件夹

删除local文件夹,actualPlatform就是""
这情况下构建结果没有了web-mobile目录,build-template下面的index.html不生效
必须build config 必须加入 actualPlatform:“web-mobile” build-template生效

官方文档里面没有提及actualPlatform也没有说明作用,这种坑都得自己来趟吗

1赞

这个是编辑器那边的已知bug,会修复的

命令行构建,只能用buildPath设置目录路径吗,dest设置了无效。可不不可以设置文件夹名
比如:构建wechatgame,目录都是wechatgame
如果可以设置文件夹名为qqgame,那么我这一次构建wechatgame,目录是qqgame
这样的话比较方便。因为QQ小程序,也是用wechatgame构建出来的,所以,同时用命令行构建这两个就不会冲突了。可以分开

我试了下用这个参数“actualPlatform”=“qqgame”,可以创建对应的qqgame目录,可以生成到qqgame,但是会提示报错
TypeError: Cannot read property ‘isNative’ of undefined。