gpt4 book ai didi

javascript - 运行描述中给出的 cordova 应用程序时出现 2-3 个弹出窗口,然后浏览器卡住

转载 作者:行者123 更新时间:2023-12-03 04:59:59 24 4
gpt4 key购买 nike

gap_init:2 
gap:[null,"CoreAndroid","messageChannel","CoreAndroid1594682113"]
gap:[null,"CoreAndroid","show","CoreAndroid1594682114"]

我正在尝试使用Angular js 2.0开发Cordova应用程序我创建了 Cordova hello world 和 Angular js 2.0 hello world 然后我合并了这两件事

但是在运行应用程序时,会生成这些弹出窗口,然后什么也没有发生

最佳答案

您使用 angular-cli 制作项目,您制作一个 cordova 项目然后在您的 angular-cli.json 文件中 -> 更改 cordova 的 www 文件夹的路径。

然后,当您进行 ng prod build 时,您的资源将被复制到 cordova 的 www 文件夹中。

我为此写了一个cordova hook,

const fs = require('fs');
const execSync = require('child_process').execSync;



module.exports = function(context) {
const basePath = context.opts.projectRoot;
const baseWWW = basePath + '/www';

process.chdir('../bmi-surgical-app');
console.log(`New directory: ${process.cwd()}`);

execSync("ng build --prod --base-href .",{stdio:[0,1,2]});

var files = fs.readdirSync(baseWWW);
for (var i = 0; i < files.length; i++) {
if (files[i].endsWith('.gz')) {
fs.unlinkSync(baseWWW + '/' + files[i]);
}
}
fs.writeFileSync(baseWWW + '/.gitignore', `# Ignore everything in this directory

*
# Except this file
!.gitignore
`);


};

但是,还有许多更好的选择,例如 NativeScript 和 Ionic 2。

关于javascript - 运行描述中给出的 cordova 应用程序时出现 2-3 个弹出窗口,然后浏览器卡住,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42268888/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com