Android Studio 2.3.2在工作配置文件或目标设备上的另一个用户帐户下启动应用程序将导致崩溃 [英] Android Studio 2.3.2 Launching the app under a work profile or another user account on the target device will result in a crash

查看:109
本文介绍了Android Studio 2.3.2在工作配置文件或目标设备上的另一个用户帐户下启动应用程序将导致崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Android Studio 2.3.2版本,我的应用程序已在模拟器以及移动设备上成功运行.进行一些更改后,它不能在移动设备上运行,但可以在模拟器中正常工作.

I have installed Android Studio 2.3.2 version, my application was running successfully on the emulator as well as mobile device. After making some changes it's not working on a mobile device but it works fine in emulator.

事件日志:

12:55 PM    Instant Run performed a full build and install since
                    the installation on the device does not match the local build on disk.
                    (Don't show again)

12:55 PM    Instant Run detected that you are running on a target device that has a work profile or multiple user accounts.
                    Launching the app under a work profile or another user account on the target device will result in a crash.
                    Learn more about how to run your app under a work profile.

推荐答案

使用此配置您的项目如果您使用Instant Run运行应用程序,并使用工作资料打开应用程序 (或其他辅助配置文件),您的应用程序将崩溃,因为只能从主配置文件的用户空间访问Instant Run使用的检测的DEX文件.

If you run your app with Instant Run and open your app using a Work profile (or other secondary profile), your app will crash because the instrumented DEX files used by Instant Run are accessible only from the primary profile's user space.

如果您想继续使用Instant Run,只需避免使用工作资料打开您的应用,并确保您的

If you want to continue using Instant Run, just avoid opening your app with the Work profile and be sure your run configuration does not use the --user user_id flag.

如果您需要在Work个人资料中使用您的应用,建议您创建一个新的运行配置,其中包含--user user_id标志,用于指定工作资料用户ID.您可以通过从命令行执行adb shell pm list users来找到用户ID.当您使用--user标志时,Android Studio仅针对该部署禁用即时运行;当您切换到没有--user标志的配置时,即时运行将再次起作用.

If you need to use your app with the Work profile, we recommend you create a new run configuration that includes the --user user_id flag, specifying the Work profile user ID. You can find the user ID by executing adb shell pm list users from command line. When you use the --user flag, Android Studio disables Instant Run for only that deployment; Instant Run will work again when you switch to a configuration without the --user flag.

要禁用即时运行,请执行以下操作:

To disable Instant Run:

  1. 打开设置"或偏好设置"对话框.
  2. 导航到构建,执行,部署>即时运行.
  3. 取消选中启用即时运行"旁边的框.

这篇关于Android Studio 2.3.2在工作配置文件或目标设备上的另一个用户帐户下启动应用程序将导致崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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