When trying to run my program on an emulator I get this error:
Device connected: emulator-5554
Device is online: emulator-5554
Target device: avd1 [emulator-5554]
Uploading file
local path: C:\Users\peter\AndroidStudioProjects\MyApplicationProject\MyApplication\build\apk\MyApplication-debug-unaligned.apk
remote path: /data/local/tmp/com.bat.myapplication
Installing com.bat.myapplication
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.bat.myapplication"
Error: Could not access the Package Manager. Is the system running?
any ideas? my paths, javahome etc, seem right....
Just wait until emulator be loaded completely, once it finished then you could simply run your application.
I had the same issue once.
First run only the emulator (it takes several minutes), and once it's loaded (the UI will change), then you run your program.
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:
Wait until the emulator 'lock screen' is showing.
Run the 'app' again (^R in most IDE's).
Choose the running device (Should be the same emulator).
App should install without error.
Related
I am building an app with ai2 but I have spend hours trying to get their emulator to work, so I have exported myapp.apk and I am trying to launch it on android studio emulator.
I have followed several tuto included the answer proposed by Tarek on that thread But I am getting and error on cmd.
Here is what I tried:
run android studio as administrator, run the emulator via the AVD manager, waited until it's started.
move myapp.apk in the sdk/platform-tools folder
created a run.bat file in this folder and wrote CMD in it5. copy your desired apk to the same folder
double click on run.bat and wrote: adb install r- "myapp.apk"
Here I am getting an error on CMD: error device not found -waiting for device-. I don't understand because my emulator is running.
I have also tried to launch the emulator without starting android studio with this command emulator -avd <avd_name> [<options>] but I get this message "the system cannot find the file specified".
The error message appears because adb cannot connect to the device although it is running. This is not supposed to happen, but it does from time to time.
You can always check if adb can see the emulator by running adb devices, which should result in a list of devices it can see. If this list is empty, the device is not found. You can resolve this by adb kill-server, waiting a couple of seconds and then running adb start-server. Try running adb devices again, and the device should be listed, and the installation should succeed.
Starting an emulator can be done by running emulator #<device-name> [options]. The device name can be found by running android list avd. This will result in a list of devices of which the <device-name> will also be listed.
I have one emulator actively running at the moment but I see two emulators running when I run the app. One of them is an Unknown Emulator.
When I choose the Unknown emulator, the console shows this error:
Error: Could not access the Package Manager. Is the system running?
How do I terminate this Unknown Simulator? I think it's using my system's resources and degrading the performance.
Well, it was the BlueStacks emulator running in the background. Android Studio automatically detects it. The unknown simulator was there because BlueStacks was running in the background at the Notification Tray in my windows 8.1
When I closed BlueStacks from the Notification Tray, the Unknown emulator vanished for good.
First reason if your emulator in offline.
To resolve this you need to run command kill-server from adb.
Open Command prompt->navigate to android sdk-> go to platform-tools-> adb kill-server -> adb start-server
You need to run above command to remove unknown
Second reason if your project configuration not match with emulator configuration
Change your emulator configuration with your project requirement. May be your application version not match with emulator configuration
It was very simple to fix for my case :) Just need to type the following 2 commands using CMD:
adb kill-server
adb start-server
Make sure that the windows PATH variable contains "adb.exe" file's directory location. Normally, it should be:
YOUR_PATH_TO_SDK\platform-tools
//For example: D:\sdk\platform-tools
Device connected: emulator-5554
Device is online: emulator-5554
Target device: AVD_for_Nexus_4 [emulator-5554]
Uploading file
local path: /home/verma/AndroidStudioProjects/Icandy1/App/build/apk/App-debug-unaligned.apk
remote path: /data/local/tmp/com.google.icandy1.app
Installing com.google.icandy1.app
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.google.icandy1.app"
Error: Could not access the Package Manager. Is the system running?
I got the above errors. Could anyone please solve this issue from Android Studio.
This is bug https://code.google.com/p/android/issues/detail?id=62113. From the bug report:
Our theory is that the IDE is trying to install the APK while the
emulator is still starting up, before it's ready to have things
installed in it. If that theory is correct, we need to have the IDE do
better detection of what state the emulator is in and have it wait
until it's ready; in the meantime, try working around it by launching
the emulator by hand, letting it get to the lockscreen and unlocking
it, and then leaving it running while you iteratively build and launch
apps from the IDE.
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:
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?
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.
If you are already running AS above 0.3.2 :
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.
Also try to install any apk in Emulator from command line
Steps to install
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.
The most common cause of this error is simple: You have to manually unlock your Android Virtual Device by swiping the “lock” icon on the screen. Security measures prevent the emulator from letting you connect the debugger before doing this.
The problem is resolved:
In Android Studio
Start run/debug
if you see the message
Do not closed the AVD, just click on run/debug again, the Application will be running when you unlock the application.
The same problem but different solution, I modified my Virtual Device, I changed Memory option and Internal Storage, and it works fine.
RAM:512 , VM HEap: 192, Internal Storage=200, SD Card Size: 200 for Device Nexus 4 android 4.2.2.
In my case this error was caused by SELinux. I got to set SELinux to permissive.
adb shell su 0 setenforce 0
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.
I had this too, and using this config worked for me :
Device: Nexus One
Target: Android 4.2.2 -api level 17
CPU/ABI: ARM (armeabi-v7a)
Keyboard: Hardware keyboard present
Memory Options:
RAM: 512
VM Heap: 192
Iternal Storage: 200
SD Card:
Size:200
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.
The same happened to me right now. I don't know if there is another but for me the following worked:
Opened AVD (Android Virtual Device) Manager
Started virtual device
Hit the Run button again (that one at status bar)
Explanation: The problem happened because of timeout. Once device had started, the Android Studio could comunicate with him. (v 0.5.3)
Remove this emulator (in the AVD)
Install this emulator (in the AVD) :)
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....
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.
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:
Wait until the emulator 'lock screen' is showing.
Run the 'app' again (^R in most IDE's).
Choose the running device (Should be the same emulator).
App should install without error.
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.
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.
Kill the process/server and restart it.! It worked.
You can avoid the error by setting default device before launching application. Launch the AVD before starting the app.
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.
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.
The solution for me was to restart the IDE. I suspect that a slow emulator was hiding from view, blocking installation on my device.
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)