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.
Related
I am new in android development.
I created the sample hello world and try to run it on a emulated nexus 7 system.
I am using android studio 1.8.14.
When I run the application, I am getting this message in andoid studio:
Waiting for device.
Target device: test_nexus_7 [emulator-5554]
Uploading file
local path: C:\Users\m\AndroidStudioProjects\MyApplication\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/com.example.m.myapplication
Installing com.example.m.myapplication
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.m.myapplication"
Error: Could not access the Package Manager. Is the system running?
what is the problem and how can I fix it?
It may be a known bug. Does this solve your issue?
"2 Error: could not access the package manager. Is the system running?
You may have gotten this error while attempting to run an Android application on an emulator or device using Android Studio. 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."
Read more at http://www.airpair.com/android/bugs-annoying-android-developers#1vMSj7GfowjRvMLG.99
Other suggestions: wait for the emulator to fully start up, which could take longer than you expected, or try debugging on an Android device, which is faster and has access to native functionality, rather than in an emulator.
i have a problem. When i am trying to deploy (Debug or Run) my App with the AndroidStudio, i get the following error in the RunLog
Waiting for device.
Target device: samsung-galaxy_nexus-WOVCBUF6BAGENRTO
Uploading file
local path: C:\Users\Abracadabra\Desktop\......\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/xxx.xxx.app
Installing xxx.xxx.app
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/xxx.xxx.app"
Segmentation fault
It works fine when i try to deploy it to the genymotion VM. It just does not work on my real device. It did work before, but i have cleaned up some folders there with the rootExplorer, for example i deleted a folder called ".Idea". Maybe this was a big mistake?
Is this the reason why it does not work anymore?
By the way, logcat is working fine for the rest of the phone.
Thanks for any help!
P.S. I also installed a fresh android with the CWM recovery tool and wiped all user and cache data -> did not help.
P.P.S I found out, that the apk is in /data/local/tmp on the phone. I can install it manually with the rootExplorer. but debugging is also not possible :/
P.P.P.S: I also have tried "adb install", also gives me segmentation fault.
It seems that copy is possible, but installation not.
Found out the reason. (a quite stupid one)
I forgot to enable "Security Settings -> Unknown Sources"
I encountered the same problem.
Waiting for device.
Target device: samsung-gt_n7100-4df180b77e139fdd
Uploading file
local path: C:\Users\Harshal\AndroidStudioProjects\MyFirstApp\CurrentAffairs\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/com.softcode.anupreet.currentaffairs
Installing com.softcode.anupreet.currentaffairs
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.softcode.anupreet.currentaffairs"
Segmentation fault
I downloaded the 'Terminal Emulator' app on my device and ran the below two commands, it was a success.
su -o pm install -r "/data/local/tmp/com.softcode.anupreet.currentaffairs"
WhenI run a project in android studio, I get this error - I/O Error: Connection refused
The emulator starts fine but doesn't pull in/reflect my project
Device connected: emulator-5554
Device is online: emulator-5554
Target device: Nexus4 [emulator-5554]
Uploading file
local path: /Users/martinsjolte/AndroidStudioProjects/FirstAPP1/Firstapp1/build/apk/Firstapp1-debug-unaligned.apk
remote path: /data/local/tmp/dk.first.Firstapp1
Installing dk.first.Firstapp1
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/dk.first.Firstapp1"
Device disconnected: emulator-5554
Launching application: dk.first.Firstapp1/dk.first.Firstapp1.MainActivity.
DEVICE SHELL COMMAND: am start -n "dk.first.Firstapp1/dk.first.Firstapp1.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
I/O Error: Connection refused
My platform is a mac osx ver.12.9.1
Ok, I don't know if i got "the" answer. but here is how I've solved the same issue on my environnement ( Windows 8/Android Studio, but same error with ADT or eclipse) :
Context of my issues :
I've got an Asus PC, and with all the application suite installed by default.
So I've found that one of this Asus app ( currently "Asus sync") was using adb and in fact, it was taking control of the emulator over my adb in the AndroidSDK directory.
How to fix as a PC user :
Go to Task manager ( right click on task bar) , and look for "adb.exe" . Then right click on it and select "Open the directory". This will bring you to the responding adb. In my case it was Asus Sync, so I just had to unistall this software and everything works fine !
How to fix as a Mac user :
Go to Activity Monitor (/Applications/Utilities/), and look for "adb". Then try to kill the process. Then look if it solve your "Connection refused" in Android studio/ADT or eclipse
If still not working you can try :
Start a emulator ( with your AVD manager)
when finished loading, Open DDMS panel (in android studio : Menu Tools > Android > Monitors DDMS)
Look if you see your current running android emulator ( listed on the Device panel)
See if this line is kind of "flashing" ( connect/disconnect).
If so, you have probably a other adb instance running in conflict
If not, you can restart adb or reinstall your SDK
Hope this could help someone !
This issue occurs when Android Debug Bridge aka ADB is not responding to the request from Android Studio. I killed the process adb.exe and started it again. This solved my problem.
If you are using a real device :
Just reconnect your device, make sure your cable are workable and you installed the proper drivers.
I had the same problem, and my problem fixed by restarting the android-studio. Hope, that will help you too.
For me the following worked(after I tried the above points mentioned by others):
I tried debugging/running anther application. It was okay. So this pointed me to the direction that the current application has some problem
if (point 1 == true) {I uninstalled the application from my phone manually }
Then re-make/rebuild the application and debug/run worked
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) :)
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.