【问题标题】:Android Studio can not install the appAndroid Studio 无法安装应用
【发布时间】:2017-06-25 23:26:30
【问题描述】:

我正在尝试创建我的第一个 android 应用程序。为此,我使用 Android Studio 2.2.3。我用单一的活动创建了一个简单的应用程序,它什么都不做,只是空屏幕,没有别的。

我正在魅族 MX6 上开发,我打开了下一个选项:

  • 安全应用程序 -> USB 安装监视器
  • 设置 -> 指纹和安全 -> 未知来源
  • 设置->辅助功能->开发者选项->USB调试

还配置了udev规则。

当我按下运行按钮时,我看到这条消息:

Installation failed with message INSTALL_FAILED_USER_RESTRICTED.
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 后,此日志将出现在控制台输出中:

$ adb push /home/***/dev/android/HelloAndroid/app/build/outputs/apk/app-debug.apk /data/local/tmp/com.android.hello.helloandroid
$ adb shell pm install -r "/data/local/tmp/com.android.hello.helloandroid"
pkg: /data/local/tmp/com.android.hello.helloandroid
Failure [INSTALL_FAILED_USER_RESTRICTED]


$ adb shell pm uninstall com.android.hello.helloandroid
DELETE_FAILED_INTERNAL_ERROR
Error while Installing APK

谁能解释一下如何解决这个问题?

【问题讨论】:

标签: android android-studio


【解决方案1】:

检查当前用户是否具有 root 访问权限。如果您还没有这样做,请启用开发者模式。

【讨论】:

    【解决方案2】:

    请在清除临时文件夹并删除项目中的构建目录后再次构建。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-05
      • 1970-01-01
      • 1970-01-01
      • 2015-02-21
      • 2018-06-18
      • 2015-04-12
      • 2021-07-29
      • 2018-01-14
      相关资源
      最近更新 更多