Flutter无法将APK突然安装到真实设备中 [英] Flutter is not able to install the apk into the real device suddenly

查看:556
本文介绍了Flutter无法将APK突然安装到真实设备中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用flutter,当我从设备上卸载应用并从终端重新运行 flutter run 时,一切突然变好了,它突然无法将apk安装到真实设备中。甚至在停止安装过程时都不会给出任何错误。

I am working with flutter currently and everything was fine suddenly when I uninstalled the app from the device and rerun flutter run from the terminal it's suddenly not able to install the apk into a real device. It's not even giving any error just getting stopped at the installation process.

导致此问题的原因

sqflite 合作,一切都很好。因此,我不得不更改架构并添加了另一个失败的表。在SO Answerer上搜索建议卸载该应用,然后重新安装(已接受的答案)。因此,我这样做了,但是每次运行 flutter run 后,它都没有安装APK。

I was working with sqflite and everything was fine. So I had to change the schema and added another table which was failing. Searching on SO answerer suggested to uninstall the app then reinstall it (was accepted answer). So I did that but after every time when I am running flutter run it is not installing the APK.

我正在运行Mac Os High Sierra 10.13.6和正在运行 flutter doctor 的设备运行正常,因为我说它可以正常工作,但在卸载后无法重新安装。

I am running Mac Os High Sierra 10.13.6 and running flutter doctor is giving everything right as I said it was working fine but not reinstalling after uninstalling.

推荐答案

< h3>问题

从主页上卸载应用程序将导致随后的 flutter run 命令在安装阶段挂起

Problem

Uninstalling the app from the home page would cause subsequent flutter run commands to hang at the installing stage.

运行 flutter run -v 运行表明安装成功,但是当adb尝试执行以下操作时,该活动将无法运行运行。

Running with flutter run -v showed that it installed successfully but the activity would not run when adb tried to run it.

错误消息是类3 $ {packageName} / $找不到{packagName} .MainActivity

更改android应用程序包的名称将使其再次起作用,直到我从手动卸载它为止

Changing the android app package name would cause it to work again until I uninstalled it manually from the phone.


  1. 多次重启电话

  2. 颤抖干净不起作用

  3. 重新启动Android Studio

  4. 重新启动计算机

  5. 重新启用USB调试

  6. 通过USB调试撤消并授权计算机

  7. 重新启用开发人员模式

  8. adb shell pm列表包$ {packageName} 不在列表中显示因此,这里没有需要清理的东西

  1. Rebooting the phone multiple times
  2. flutter clean didn't work
  3. Restarting Android studio
  4. Restarting my computer
  5. Re-enabling USB debugging
  6. Revoking and authorizing my computer from USB debugging
  7. Re-enabling developer mode
  8. adb shell pm list package ${packageName} didn't show it in the list so there was nothing to clean through there



永久修复



adb卸载$ {packageName} 并显示成功。现在,随后的抖动运行非常正常。

Permanent fix

adb uninstall ${packageName} and it showed 'Success'. Now subsequent flutter runs work perfectly.

似乎从主屏幕卸载应用确实会留下一些问题意图或活动在某处的某些缓存中。

It seems uninstalling apps from the home screen does leave some intent or activities in some cache somewhere.

这篇关于Flutter无法将APK突然安装到真实设备中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆