Error: Could not access the Package Manager. Is th

2019-01-17 15:38发布

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?

I installed sdk version and configured emulator. Any suggestions?

Here is emulator confiuration:

emulator confiuration

Update:

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?

How to solve this error?

8条回答
祖国的老花朵
2楼-- · 2019-01-17 16:29

I had this issue, but I found that simply killing the emulator and restarting it worked. There seems to be some sort of race condition where the emulator has not initialized before Android Studio tries to launch the apk and so you get the package error.

查看更多
forever°为你锁心
3楼-- · 2019-01-17 16:29

This Is Worked for me

1)Close Solution.

2)Close Emulator.

3)Run Emulator and Wait till it launch completely and shows Home Screen.

4)After that only Open Solution And Clean,Rebuild and Try to deploy Application.

查看更多
登录 后发表回答