Flutter无法将APK突然安装到真实设备中 [英] Flutter is not able to install the apk into the real device suddenly
问题描述
我目前正在使用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.
- 多次重启电话
-
颤抖干净
不起作用 - 重新启动Android Studio
- 重新启动计算机
- 重新启用USB调试
- 通过USB调试撤消并授权计算机
- 重新启用开发人员模式
-
adb shell pm列表包$ {packageName}
不在列表中显示因此,这里没有需要清理的东西
- Rebooting the phone multiple times
flutter clean
didn't work- Restarting Android studio
- Restarting my computer
- Re-enabling USB debugging
- Revoking and authorizing my computer from USB debugging
- Re-enabling developer mode
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屋!