当前位置: 首页 > 知识库问答 >
问题:

Android应用程序开始更新cordova webintent并强制停止

祖麻雀
2023-03-14

步骤:

>

然后我打电话给cordova webintent安装更新

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

这个问题很久以前就出现了,我不明白为什么会发生这种情况,因为cordova webintent和cordova的版本是一样的。

为什么安装时应用程序强制停止?

日志:

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

--------- beginning of system

I/ActivityManager(  715): [Background Service Priority Adjustment] Set callerFg as false for service.getFlags():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.android.packageinstaller/.PackageInstallerActivity} from uid 10657 on display 0

--------- beginning of main

I/ActivityManager(  715): START u0 {dat=file:///storage/emulated/0/filename1.apk cmp=com.android.packageinstaller/.InstallAppProgress (has extras)} from uid 10072 on display 0
I/ActivityManager(  715): [AppLaunch] Displayed Displayed com.android.packageinstaller/.InstallAppProgress: +135ms

I/ActivityManager(  715): Force stopping 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): notify app switch quit packageName=com.example.hello1
I/ActivityManager(  715):   Force finishing activity ActivityRecord{16a2ad7e u0 com.example.hello1/.MainActivity t2758}

I/ActivityManager(  715):   Force finishing activity ActivityRecord{32eb6933 u0 com.android.packageinstaller/.InstallAppProgress t2758}

**W/ActivityManager(  715): Spurious death for ProcessRecord{2590ad4d 19149:com.example.hello1/u0a657}, curProc for 19149: null**

I/ActivityManager(  715): Force stopping com.example.hello1 appid=10657 user=-1: update pkg
I/ActivityManager(  715): Force stopping com.example.hello1 appid=10657 user=0: pkg removed

共有1个答案

尹承泽
2023-03-14

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

  • 与线程相关的问题,取决于手机或平板电脑的处理器类型(可以同时运行多少线程),请记住cordoba webintent是一种基于异步的调用

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

<intent-filter>
     <action android:name="com.example.yourapplication.hello1" />
     <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

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

startActivity({action: 'com.example.yourapplication.hello1'}) 

这里可以方便地使用{}来测试webintent是否在应用程序的MainActivity()之前或之后触发。如果MainActivity()有额外参数,请检查意图“激发”顺序。

第二种情况是:

  • 从gitHub下载cordoba webintent

我希望针点不同的方法,以您的情况!

 类似资料:
  • 如果按照步骤设置强制停止应用程序-

  • 我试图弄清楚如何从Play商店强制更新最新版本。 由于我的android应用程序的旧版本已经在play store中,我还没有执行检查,以获取应用程序的当前版本,并与链接中指定的play store应用程序版本进行比较,请强制更新android应用程序 当我想上传新版本的代码时,他才可以使用新版本。 你能帮帮我吗?

  • 我有一个应用在谷歌Play商店。当一个更新版本可用时,旧版本将变得不可用--也就是说,如果用户不更新app,他们就不在app中进入。当新版本可用时,我如何强制用户更新应用程序?

  • 我有一个用展览编写的应用程序,但不知道如何推送新版本。在博览会网站上,如果我从二维码运行应用程序,应用程序是正确的,但应用程序商店的本机应用程序不会更新。 我使用的步骤是1)exp build:android 2)exp publish 如何让应用程序真正更新?

  • 我正在尝试从应用程序开始屏幕录制,并遇到一些问题。我读过很多关于执行命令的文章,但似乎没有什么帮助。 问题是,当我开始屏幕记录文件时,它创建的大小为3014字节 <代码>(内容:[...]ftypisom[...]isom3gp4[...]),文件中不会记录任何内容。 我该如何修复它?

  • 我目前正在使用weblogic,问题是我在我的weblogic服务器上部署了几个应用程序。不幸的是,当这个应用程序中的一个由于X/Y原因而无法部署时,我只想强制停止这个应用程序并传递给另一个。 我已经查看了WLST文档,但没有找到我要搜索的内容。以下是我使用的函数: 停止应用程序(applicationName,gracefulProductionToAdmin=“true”,gracefulIg