cordova - 离子代码推送更新失败:无法在 preInstallFailure 获取包起始页
问题描述
从客户端上的应用程序更新后,我遇到了以下错误。客户端上的应用程序确实检索了更新版本。但随后错误发生了。
[app-scripts] [15:01:09] console.error: [CodePush] An error has occured while installing the package. Could not get the package start
[app-scripts] page. StackTrace: Error: An error has occured while installing the package. Could not get the package start
[app-scripts] page at preInstallFailure
[app-scripts] (http://192.168.2.3:8100/plugins/cordova-plugin-code-push/bin/www/localPackage.js:246:41) at
[app-scripts] Object.callbackFromNative (http://192.168.2.3:8100/cordova.js:293:52) at processMessage
[app-scripts] (http://192.168.2.3:8100/cordova.js:1114:17) at processMessages (http://192.168.2.3:8100/cordova.js:1137:9)
[app-scripts] at http://192.168.2.3:8100/build/vendor.js:130322:26 at t.invoke
[app-scripts] (http://192.168.2.3:8100/build/polyfills.js:3:14976) at r.run
[app-scripts] (http://192.168.2.3:8100/build/polyfills.js:3:10143) at http://192.168.2.3:8100/build/polyfills.js:3:20242
[app-scripts] at t.invokeTask (http://192.168.2.3:8100/build/polyfills.js:3:15660) at r.runTask
[app-scripts] (http://192.168.2.3:8100/build/polyfills.js:3:10834)
这是我的 config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="cn.bookheart.app" version="0.0.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
...
<content original-src="index.html" src="http://192.168.2.3:8100" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
...
<platform name="android">
<allow-intent href="market:*" />
<preference name="AndroidLaunchMode" value="singleTask" />
<preference name="android-build-tool" value="gradle" />
...
</platform>
这是我的 package.json
{
"name": "example",
"version": "0.0.2",
"homepage": "http://example.com/",
...
我试图重新安装平台 android 然后更新版本,但它是同样的错误。
解决方案
请确保您在使用ionic build cordova android
.
由于release-cordova
命令仅构建 cordova 项目(不是 Ionic)。
推荐阅读
- c# - 如何在 DTO 中映射相关 DTO 列表:嵌套 DTO 映射
- sql - SQL Server中如何根据组将行重新整形为列
- excel - 与多个用户共享的宏不会复制/粘贴到工作簿中
- python - AWS Lex 和 Facebook 打字动画
- android - 从 PC 到移动通信
- html - 如何使用 CSS 创建锯齿形?
- python - 如何在滚动窗口中应用 Python 中的赫斯特指数
- java - 以下哪个方法是重载的,哪个是覆盖的?
- python - DjangoRestFramework:AttributeError:'str'对象没有属性'_meta'
- google-sheets - 如何从 Google 表格的查询中删除“编辑权限”?