Cordova Build未更新ios平台目录中的index.html
Cordova Build not updating index.html in ios platform directory
我正在使用:
Cordova 5.3.3
Xcode 6.2
学习Cordova教程:https://ccoenraets.github.io/cordova-tutorial/
修改运行cordova build-ios的index.html,www目录在ios平台目录中没有更新。
当我更新根目录中的文件时,cordova prepare和cordova prepare-ios也不会更新ios的www目录。
我搜索并找到了这个解决方案:
22231767
它引用
找到名为copy-ww-build-step.sh的文件。我的是在[project_folder]/platforms/ios/cordova/lib/copy-ww-build-step.sh 中
然而,在我的安装中,我有一个javascript文件,而不是shell脚本-版本可能是
[project_folder]/platforms/ios/cordova/lib/copy-ww-build-step.js
在那个文件中:
var BUILT_PRODUCTS_DIR = process.env.BUILT_PRODUCTS_DIR,
FULL_PRODUCT_NAME = process.env.FULL_PRODUCT_NAME,
COPY_HIDDEN = process.env.COPY_HIDDEN,
PROJECT_FILE_PATH = process.env.PROJECT_FILE_PATH;
var path = require('path'),
fs = require('fs'),
shell = require('shelljs'),
glob = require('glob'),
srcDir = 'www',
dstDir = path.join(BUILT_PRODUCTS_DIR, FULL_PRODUCT_NAME),
dstWwwDir = path.join(dstDir, 'www');
if(!BUILT_PRODUCTS_DIR) {
console.error('The script is meant to be run as an Xcode build step and relies on env variables set by Xcode.');
process.exit(1);
}
try {
fs.statSync(srcDir);
} catch (e) {
console.error('Path does not exist: ' + srcDir);
process.exit(1);
}
// Code signing files must be removed or else there are
// resource signing errors.
shell.rm('-rf', dstWwwDir);
shell.rm('-rf', path.join(dstDir, '_CodeSignature'));
shell.rm('-rf', path.join(dstDir, 'PkgInfo'));
shell.rm('-rf', path.join(dstDir, 'embedded.mobileprovision'));
// Copy www dir recursively
if(!!COPY_HIDDEN) {
shell.mkdir('-p', dstWwwDir);
shell.cp('-r', glob.sync(srcDir + '/**', { dot: true }), dstWwwDir);
} else {
shell.cp('-r', srcDir, dstDir);
}
// Copy the config.xml file.
shell.cp('-f', path.join(path.dirname(PROJECT_FILE_PATH), path.basename(PROJECT_FILE_PATH, '.xcodeproj'), 'config.xml'),
dstDir);
所以看起来shell.cp('-r', srcDir, dstDir);
应该在这里做复制工作。然而,在我的情况下,副本不起作用。
你知道吗。。。这不是你所希望的答案,但我在phonegap构建服务中也注意到了同样的事情。有时我只需要多次运行build命令。
也许你有一个当前构建用户不允许写的文件,因为可能是管理员拥有它。祝你好运
当我用自制软件安装节点时,我的修复程序是
brew tap homebrew/versions
brew unlink node
brew uninstall node
brew search node (gives the list of available version)
brew install homebrew/versions/node4-lts
在这一点上,ios构建是成功的,但正如jcesarmobile所指出的,Cordova 5.4.0已经发布,解决了这个问题。
- 分析高度属性时出现意外值{{specs.height}}.index.html
- AngularJS-需要在index.html页面中访问来自服务的数据
- index.html使用webpack开发服务器未重新加载
- 从index.html调用函数,该函数无限循环
- RouteChangeStart事件在初始index.html页面加载时触发
- Angular2:Index.html没有't显示该文件;正在加载&”;
- 如何使用gulp-inject将文件的内容插入到我的index.html中
- 使url匹配'/''/索引'和'/index.html'到单一状态
- 将所有angular2捆绑包包含在index.html中会使导入从内存获取数据,而不是再次从服务器请求数据
- 咕哝式发球;t将index.html与'/'要求
- AngularJS应用程序:如何将.js文件包含到index.html中
- 无法从index.html调用javascript函数
- 捕获刷新并将页面更改为index.html
- 添加java脚本后,Dropdown Menu无法在Index.html上工作
- jquery手机应用程序的第一页必须是index.html
- Angular 2-我如何使我的index.html文件的标题和关键字和描述的元标签是动态的
- 使index.html的默认状态不带#something
- 从'更改不同语言的图像;index.html'到'关于.html'
- ng递归地包括整个index.html;达到“10$digest()迭代”;
- angular-index.html只识别默认路由中定义的函数