Error in Android Studio: Installation did not succeed [duplicate] - android

How to fix ("cmd package install-create -r -t -S 1699739' returns error 'Unknown failure: cmd: Can't find service: package") error when i launch the emulator.
'cmd package install-create -r -t -S 1699739' returns error 'Unknown failure: cmd: Can't find service: package'
20:20 Session 'app': Install failed.
Installation failed
Rerun

It's not your fault. The problem is with the functionality of emulator .
SO,
Close the Emulator.
Go to AVD manager and edit virtual device Quick Boot to Cold Boot.

Try the following steps:
Close the emulator
Cold boot app
Clean Build
Open emulator
Run app

1- Close your emulator
2- Go to AVD Manager
3- Click the down arrow next to your emulator -> cold boot now

I had same problem. This is what I did.
Force quit the emulator.
Go to Android Studio, Click on AVD Manager.
In the action column (last column), click the arrow facing down.
Click Cold Boot Now.
Run code from Android Studio again. Things should run normally.
Usually, this happened because the emulator freeze due to the laptop goes to sleep for a long time.

I would suggest you to run the app again. I was also having the similar problem but when i run the app again, the issues got fixed. If it doesn't solve the problem then create a new adv and start launching your app on it.

Do check once if there are multiple instances of emulator running. I got this error when I had 2 instances of emulator running.

Go To AVD Manager on Android studio
Select the Edit option
Select Boot Option as "Cold Boot"
Launch the Emulator
This should fix your problem

Related

Error when running the emulator on Flutter in Android Studio

When running the emulator on Flutter in Android Studio adb.exe exists in AppData\Local\Android\Sdk\platform-tools, but I get an error saying "Unable to locate adb."
Also, pressing the "Open Android Emulator: ~" button causes the following error:
Error Opening Emulator
emulator: ERROR: Running multiple emulators with the same AVD is an experimental feature. Please use -read-only flag to enable this feature. .
What should I do?enter image description here
That alert comes up very often but the emulator starts up nevertheless. If the emulator doesn't start, click the down button(next to the play button for your emulator in the AVD manager) and select stop/disable to stop the process and try again.
I ran into this while running Cygwin on Windows with a repo I'd cloned using the Cygwin git. It looks as if Flutter launches things differently from regular Android Studio.
I was able to solve this with:
cd \users\(me)\AppData\Local\Android\Sdk\platform-tools
chmod -R u+x *
(That's the Cygwin /usr/bin/chmod on my path.) After that, adb started in a Flutter project.

how to fix 'cmd package install-create -r -t -S 1699739' returns error 'Unknown failure: cmd: Can't find service: package'

How to fix ("cmd package install-create -r -t -S 1699739' returns error 'Unknown failure: cmd: Can't find service: package") error when i launch the emulator.
'cmd package install-create -r -t -S 1699739' returns error 'Unknown failure: cmd: Can't find service: package'
20:20 Session 'app': Install failed.
Installation failed
Rerun
It's not your fault. The problem is with the functionality of emulator .
SO,
Close the Emulator.
Go to AVD manager and edit virtual device Quick Boot to Cold Boot.
Try the following steps:
Close the emulator
Cold boot app
Clean Build
Open emulator
Run app
1- Close your emulator
2- Go to AVD Manager
3- Click the down arrow next to your emulator -> cold boot now
I had same problem. This is what I did.
Force quit the emulator.
Go to Android Studio, Click on AVD Manager.
In the action column (last column), click the arrow facing down.
Click Cold Boot Now.
Run code from Android Studio again. Things should run normally.
Usually, this happened because the emulator freeze due to the laptop goes to sleep for a long time.
I would suggest you to run the app again. I was also having the similar problem but when i run the app again, the issues got fixed. If it doesn't solve the problem then create a new adv and start launching your app on it.
Do check once if there are multiple instances of emulator running. I got this error when I had 2 instances of emulator running.
Go To AVD Manager on Android studio
Select the Edit option
Select Boot Option as "Cold Boot"
Launch the Emulator
This should fix your problem

Emulator: emulator: ERROR: Running multiple emulators with the same AVD is an experimental feature

I removed the emulator and reinstalled it and got the same error.
Emulator: emulator: ERROR: Running multiple emulators with the same AVD is an experimental feature.
Emulator: Process finished with exit code 1.
Removing the .lock files did the trick for me. Find the avd and remove the lock files. In a Mac .android/avd/'NAMEOFAVD.avd directory . The files I removed were hardware-qemu.ini.lock and multiinstance.lock.
It can be solved using this method. It worked for me.
Follow the steps:
Open Android Studio.
Go to AVD Manager.
In the Actions column, for the respective avd, click on the down arrow and click on Stop.
This will stop the Emulator and then you can restart it from the command line.
This means that your AVD manager thinks that your emulator is running. It thinks that because it sees lockfiles in your avd directory. If your emulator is not running they you can (should) safely delete the lockfiles here :
$ rm $HOME/.android/avd/<name-of-your-avd>.avd/*.lock
Same emulator error
ERROR: Running multiple emulators with the same AVD is an experimental feature.
fixed with removed lock for AOSP device which located
./out/target/product/generic_car_x86_64/multiinstance.lock
./out/target/product/generic_car_x86_64/hardware-qemu.ini.lock
Also check permission for /dev/kvm
On Linux, you should try this:
sudo rm /home/${USER}/.android/avd/*/*.lock
On Mac:
rm $HOME/.android/avd/*.avd/*.lock
Hope it will help.
Make sure you don't have any physical device connected to your computer, in addition to removing all emulators' .lock
Removing the cache could help
sudo rm /home/${USER}/.android/avd/*/*.cache
The very simple solution which is working all the time is to stop the emulator before launching the new project. If this error comes back you make a duplication of the AVD and delete the old one and run the new one. It works all the time.
just open your task manger, look for adb.exe, end task of all abd.exe extensions and restart your emulator.
my problem solved by closing the emulator and letting the test run the emulator automatically
I faced the same issue, I tried all the solutions above not fixed,
then I used the wipe data option from the device manager then it works fine.

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

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)

Android emulator error: user data image is used by another emulator

I Got this type of error when Run a program on emulator.
ERROR: the user data image is used by another emulator. aborting
Exit from eclipse and ADB , and watch your task manager that how much emulator is running. is there anymore then one then close it and restart the eclipse and start ADB.
reboot your computer, this happens when the ADB bridge crashes sometimes.
I've found that stopping and restarting the emulator (and perhaps Eclipse) will fix it - less drastic than rebooting.

Categories

Resources