Android应用程序启动更新与cordova-webintent并强制停止

Iul*_*iko 34 android install updates cordova webintents

步骤: 1)打开Android应用程序(内置cordova)

2)然后我呼吁cordova-webintent安装更新 https://github.com/Initsogar/cordova-webintent

3)我按下Install并开始安装,但几秒后app强制停止并关闭而不是安装并打开更新的应用程序.

这个问题出现在前一段时间,我无法理解为什么会发生这种情况,因为同一版本的cordova-webintent和cordova.

4)应用程序强制停止后,我点击应用程序图标,但是有一条消息"未安装应用程序".几秒后,应用程序继续在后台安装.我再次点击应用程序图标,打开更新的应用程序.

请帮助修复安装时app force stop的问题.

日志:

E:\ work\hello1> adb logcat ActivityManager:我com.example.hello1:D*:S

---------系统的开头

I/ActivityManager(715):[后台服务优先级调整]将service.getFlags()的callerFg设置为false:260

I/ActivityManager(715):START u0 {act = android.intent.action.VIEW dat = file:///storage/emulated/0/filename1.apk typ = application/vnd.android.package-archive cmp = com.来自uid 10657的android.packageinstaller/.PackageInstallerActivity}显示0

---------主要的开始

I/ActivityManager(715):从uid 10072上显示0 I/ActivityManager START u0 {dat = file:///storage/emulated/0/filename1.apk cmp = com.android.packageinstaller/.InstallAppProgress(has extras)} (715):[AppLaunch]显示显示的com.android.packageinstaller/.InstallAppProgress:+ 135ms

I/ActivityManager(715):强制停止com.example.hello1 appid = 10657 user = -1:uninstall pkg

I/ActivityManager(715):Killing 19149:com.example.hello1/u0a657(adj 1):stop com.example.hello1

W/ActivityManager(715):通知应用程序开关退出packageName = com.example.hello1 I/ActivityManager(715):强制完成活动ActivityRecord {16a2ad7e u0 com.example.hello1/.MainActivity t2758}

I/ActivityManager(715):强制完成活动ActivityRecord {32eb6933 u0 com.android.packageinstaller/.InstallAppProgress t2758}

W/ActivityManager(715):ProcessRecord的虚假死亡{2590ad4d 19149:com.example.hello1/u0a657},curProc for 19149:null

I/ActivityManager(715):强制停止com.example.hello1 appid = 10657 user = -1:update pkg I/ActivityManager(715):强制停止com.example.hello1 appid = 10657 user = 0:pkg已删除

Geo*_*dis 1

我处理你的问题有两个潜在的原因:

  • 与线程相关的问题,取决于手机或平板电脑的处理器类型(可以同时运行多少个线程),请记住,cordoba-webintent 是基于异步的调用。
  • 两个相同的版本(cordoba-webintent 和 cordoba)可能会缺少常见的插件。(插件本来应该存在,但没有包含在内!)

在第一种情况下,首先检查您的清单:

<intent-filter>
     <action android:name="com.example.yourapplication.hello1" />
     <category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)

当然它应该有一个独特的名字。然后检查你的java代码,在你调用webintent的地方

startActivity({action: 'com.example.yourapplication.hello1'}) 
Run Code Online (Sandbox Code Playgroud)

atry{}在这里可以很方便地测试 webintent 是在应用程序的MainActivity(). 如果您的 MainActivity() 参数,还要检查意图“fire”顺序(has extras)。

第二种情况是:

  • 从gitHub下载 cordoba-webintent
  • 构建你的应用程序
  • 解压并找到插件目录
  • 将此插件目录包含在您的项目中
  • 这种方式将确保 webintent 安装了最新的更新,并且在您之前运行的自动更新期间没有任何问题。

我希望能为您的案例指出不同的方法!