错误:无法访问包管理器.系统在运行吗?- 在 Android Studio [英] Error: Could not access the Package Manager. Is the system running? - At Android Studio

查看:22
本文介绍了错误:无法访问包管理器.系统在运行吗?- 在 Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 android studio 并尝试运行简单的项目.

I installed android studio and tried to run easy projects.

但我发现了奇怪的错误信息:

But I caught strange error message:

Waiting for device.
/usr/local/idea/android-studio/sdk/tools/emulator -avd Nexus-4-18-xhdpi -netspeed full -netdelay none

emulator: emulator window was out of view and was recentered

Device connected: emulator-5554
Device is online: emulator-5554
Target device: Nexus-4-18-xhdpi [emulator-5554]
Uploading file
    local path: /home/nazar/Documents/coursera-android/Examples/HelloAndroid/out/production/HelloAndroid/HelloAndroid.apk
    remote path: /data/local/tmp/course.examples.HelloWorld.HelloWorld
Installing course.examples.HelloWorld.HelloWorld
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/course.examples.HelloWorld.HelloWorld"
Error: Could not access the Package Manager.  Is the system running?

我不明白为什么会这样?

I couldn't figure out why this happen?

我安装了 sdk 版本并配置了模拟器.有什么建议吗?

I installed sdk version and configured emulator. Any suggestions?

这是模拟器配置:

更新:

我尝试安装 Genymotion 设备并使用少量虚拟设备,但被发现:

I tried to install Genymotion device and use few virtual devices, but caught:

Waiting for device.
Target device: genymotion-nexus_4___4_4_2___api_19___768x1280-192.168.56.101:5555
Uploading file
    local path: /home/nazar/Documents/coursera-android/Examples/HelloAndroid/out/production/HelloAndroid/HelloAndroid.apk
    remote path: /data/local/tmp/course.examples.HelloWorld.HelloWorld
Installing course.examples.HelloWorld.HelloWorld
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/course.examples.HelloWorld.HelloWorld"
WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
Error: Could not access the Package Manager.  Is the system running?

如何解决这个错误?

推荐答案

首先确保您运行的是高于 0.3.2 的 Android Studio 版本,因为在 AS 0.3.2 中报告了一些与此相关的问题.如果不是,您可以从 Help >Check for update 更新它.

First make sure you are running Android Studio version above 0.3.2 because there was some issue reported regarding the same in AS 0.3.2 . If it is not you can update it from Help >Check for update.

如果您已经在 0.3.2 以上运行 AS:

If you are already running AS above 0.3.2 :

问题似乎出在您的模拟器上,而不是在 Android Studio 上.您可能会在模拟器未正常启动之前尝试安装应用程序.

Seems like issue is with your emulator not with Android Studio. It may happen that you are trying to install application before even the emulator started properly.

等待主屏幕出现在模拟器中,然后再尝试安装任何应用程序.

Wait till the home screen appears in the emulator before trying to install any application.

还尝试从命令行在模拟器中安装任何 apk

Also try to install any apk in Emulator from command line

安装步骤

  • 转到 $Android_SDK_DIR\platform-tools,右键单击那里保持按下 shift 键并选择在此处打开命令窗口".
  • 运行命令 adb devices 以确保您的模拟器正在运行适当地.它将显示您所有正在运行的模拟器.
  • 现在,如果模拟器显示正常,请输入命令 adb installYOUR_FULL_APK_PATH , YOUR_FULL_APK_PATH 是任何 .apk 文件路径您的系统.
  • Go to $Android_SDK_DIR\platform-tools, right click there keeping shift key pressed and Chose "Open Command Window here".
  • Run command adb devices to make sure yout emulator is running properly. It will show all your running emulators.
  • Now if emulators are showing properly, type the command adb install YOUR_FULL_APK_PATH , YOUR_FULL_APK_PATH is of any .apk file path in your system.

如果一切正常,请更新.

Please update if this works fine.

这篇关于错误:无法访问包管理器.系统在运行吗?- 在 Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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