应用程序可以在模拟器运行但不能在真机运行的解决方法

    xiaoxiao2021-03-25  169

    如果你的App可以正常运行在你的模拟器,但是运行在真机的时候却抛出这样的问题:

    Installation failed with message null. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

    WARNING: Uninstalling will remove the application data!

    Do you want to uninstall the existing application?当你点击OK后还是不能在真机运行。你就要这样解决了:

    清空手机里的缓存

    clean project

    禁止了Instent Run

    更新了Android studio版本

    在build gradle中添加了buildTypes {

    debug { debuggable true} 以及在mainifests中添加 android:debuggable="true"

    rebuild project

    安装了你的电脑最新的Android USB驱动

    打开系统自带的手机管家APP,进入权限管理,点击usb安装管理,关闭 usb安装管理就可以使用设置->开发者选项->usb安装(允许通过usb安装应用),启用这个。通过命令行,adb install -r 后面跟你的打好包的APK尝试adb uninstall 包名,再安装如果以上方法都没有解决你的问题那就只能通过最后一个方法了,在豌豆荚或手机助手上面备份你的数据,然后恢复手机出厂模式,最后一招是绝对有用的!

    希望能帮你解决这个问题! 原创不易转载请注明出处!

    转载请注明原文地址: https://ju.6miu.com/read-17445.html

    最新回复(0)