could not access the package manager. is the system running while installing android application

AndroidAndroid EmulatorRuntime Error

Android Problem Overview


While installing the android application in the emulator I am getting the following error.

Please help me to resolve this error.

Error message:

emulator.exe -avd avd_name

adb wait-for-device    

adb install path-to.apk    

could not access the package manager. is the system running while installing android application....

Android Solutions


Solution 1 - Android

You need to wait for the emulator to full start - takes a few minutes. Once it is fully started (UI on the emulator will change), it should work.

You will need to restart the app after the emulator is running and choose the running emulator when prompted.

Solution 2 - Android

As other have said, this error occurs because the emulator is still in the process of launching. An attempt to access the package manager, for the device, at this time causes an error.

It's just a simple timing issue. Here are the steps to avoid this error:

  1. Wait until the emulator 'lock screen' is showing.
  2. Run the 'app' again (^R in most IDE's).
  3. Choose the running device (Should be the same emulator).

App should install without error.

Solution 3 - Android

In my case it was just that the emulator took 9 minutes to start. Wait until you see the lock icon on the emulator LCD. Or use actual tablet or phone.

Solution 4 - Android

Facing Same issues following Link helped solving the problem. The above solutions were not helpful for me. deployment-failed-could-not-access-the-package-manager-is-the-system-running

By restarting server using CMD application was back to work. Open cmd (Run as administrator), open this

cd C:\Program Files (x86)\Android\android-sdk\platform-tools

(this path must specify your android-sdk installation folder )

Now, first write, adb kill-server and then adb start-server.

Solution 5 - Android

Kill the process/server and restart it.! It worked.

Solution 6 - Android

You can avoid the error by setting default device before launching application. Launch the AVD before starting the app.

Solution 7 - Android

Once you see this error, wait for emulator to show lock screen. And then relaunch the app in your IDE and check the emulator again. It works for me always.

In Android studio, you can relaunch by clicking the green play button or ctrl + r.

Solution 8 - Android

If this error is gotten when using a rooted device's su prompt and not from emulator, disable SELinux first

setenforce 0

You may need to switch to shell user first for some pm operations

su shell

then re-run your pm command.

Same applies to am commands unavailable from su prompt.

Solution 9 - Android

The solution for me was to restart the IDE. I suspect that a slow emulator was hiding from view, blocking installation on my device.

Solution 10 - Android

Check your project build is in Debug mode not Release, I had some problem for debugging always I forget to change Release mode to Debug (Xamarin Users)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionarunkumar.pView Question on Stackoverflow
Solution 1 - AndroidssaltmanView Answer on Stackoverflow
Solution 2 - AndroidSaeed GatsonView Answer on Stackoverflow
Solution 3 - AndroidTrevorView Answer on Stackoverflow
Solution 4 - AndroidDivyaView Answer on Stackoverflow
Solution 5 - AndroidFrankensteinView Answer on Stackoverflow
Solution 6 - AndroidSofia KhwajaView Answer on Stackoverflow
Solution 7 - AndroidIamLearningView Answer on Stackoverflow
Solution 8 - AndroidFortuneView Answer on Stackoverflow
Solution 9 - AndroidBerit LarsenView Answer on Stackoverflow
Solution 10 - AndroidAli YousefiView Answer on Stackoverflow