android install failure - "cmd: Can't find service: package" (not emulator) - android

I'm trying to test some apks on a HiKey 960 with Android (AOSP), but whenever I try to install any apk I get:
adb: failed to install whatever.apk: cmd: Can't find service: package
This is with either
adb install -t whatever.apk
or through Android Studio 4.0
Almost all searches for this error suggest I cold boot my emulator, but I'm not using an emulator...
The only non-emulator result came up with it being a lack of space, but the HiKey is virtually empty, and has 3.3GB free, and my various trial apks are relatively small.
Has anyone struck this error before without an emulator, and have any ideas on what the problem might be? I'd like to avoid re-installing my whole HiKey if I can...

From feedback elsewhere I eventually found someone who'd had the same problem. The 'package' service doesn't startup when booted, and the only fix was to re-image the HiKey device.
So that's what I'm doing.

I had the same problem with Redmi Note 4 and after rebooting phone the error was gone.

Related

Android Studio has extra unkown device

I am trying to do some remote debugging in Android Studio.
Recently I've had an issue where an extra device will pop-up named Unknown Device so when i run adb tcpip 5555 I get the error message: error: more than one device/emulator
So I need to get rid of this Unknown Device
So far here is what I've tried:
adb kill-server
Invalidate Android Studio Cache and restart
Restart my computer
Looked for anything in ~/.android/avd/ which may cause it (There was nothing)
Ran Android Studios troubleshooter which restarted adb
None of the above worked, does anyone have any idea what this Unknown Device may be, and how I can get rid of it?
Alright, so I did a check for updates in android studio, and there was a minor update available. After installing the minor update, the problem went away - It must've been some bug in whatever Android Studio version I had.

Android Studio - Logcat not working for emulator but OK for phone

I'm very new to Android Studio. I have been using it on Windows but the machine was too old to run any of the emulators so I installed it (via Ubuntu Software store) on a laptop running Unbuntu 18.04.
It all seems to work OK except the Logcat does not show anything. Sometimes, after cold starting the emulator, I get some output to the Logcat but then it just halts and nothing I do (see below) causes it to output anything else.
I cannot get ANY output when running an app.
I have searched extensively here and via Google and tried the following:
restarted the Studio
restarted logcat
killed and restarted adb
invalidate caches and restart AS
deleting and recreating AVDs
use logcat via AS built in terminal and external shell :
./adb -s emulator-5554 logcat
and get:
Unable to open log device '/dev/log/main': No such file or directory
NB: When using an attached phone e.g. Moto G. the logcat works fine. I get all the system output and the app output works as expected.
Thanks in advance
2019-12-14 UPDATE: when the emulator is running it shows the active processes (see screenshot) in the drop down, including my app but NO entries. Not sure if this gives anyone a clue? It is clearly communicating with the emulator in some way.
2019-12-16 UPDATE: Started in from scratch. Installed MX Linux 19 and fresh Studio install. Created new AVD. EXACTLY THE SAME!!! This is so ridiculous. Anyone, please?
sometimes you might be trying to use a gun to kill a fly. For a try, ensure that the emulator you have run is actually selected in logcat like in this screen shot
.

Phonegap run android command hangs on trying to install app onto device

I'm working on Phonegap for few days. Before this I was able to run phonegap apps into emulator through command line successfully, but now that's showing a peculiar hang; nothing happening no error, no flow of execution.
Now I'm running my apps by installing the .apk file directly through Android command line. But, still I want to know why it's not working, why this run command hangs there?
In my case ADB DEVICES displayed me invalid devices, an ADB KILL-SERVER solved this for me.
i suspect that is was caused by a my laptop going into sleep mode.
when it says trying to install app onto device the command is actually running adb install C:/yourpath/yourapp.apk which copies the app the android installation.
You shouldn't worry if it takes a long time. The installation is proceeding as planned, just be patient. The bigger your app, the longer is takes. For me a ~300MB app takes a full 7 mins to install to an attached device via USB. And the same app will take 13 mins to install to an Android emulator.
The emulator is known to be slow, there's a big SO thread regarding this issue here - Why is the Android emulator so slow? How can we speed up the Android emulator?

ADB Push INSTALL_PARSE_FAILED_NO_CERTIFICATES

I am currently having a problem with my ZeniThink Android tablet with Jellybean, this is that all words I type in on every application underlines itself in red implying it is not in the dictionary. I searched on the internet and found two apk's to copy to system> app folder however one will not copy which I am to believe it is a common error and that to overcome it you should ADB push. The apk's I found are LatinIme.apk and LatinImeGoogle.apk, which is the one that will not copy. (Source: http://www.androidtablets.net/forum/coby-generation-3-technical/45920-predictive-spelling-dictionary-solved.html#post236467)
I understand nothing about ADB but have been following video tutorials on YouTube and have managed to connect my device to Android SDK using WiFi as I do not have a USB cable for my tablet. I tried to copy/install the apk. by using this code:
adb install LatinImeGoogle.apk
However, I get this error:
C:\adt-bundle-windows-x86_64-20130522\sdk\platform-tools>adb install LatinImeGoo
gle.apk
9 KB/s (6160710 bytes in 663.958s)
pkg: /data/local/tmp/LatinImeGoogle.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
As I know absolutely nothing about ADB or anything to do with developing, by reading posts on this website, I am really struggling to find a solution.
Please help me stop the horrible underlining of words!
Thanks in Advance,
James
i met this issue before,
same code and ketstore compile the build(winxp&jdk1.6) and throw this error when installing;
When I try to change other pc and compile (win7&jdk7.0) and this issue cannot be happened;
I think you can try the same way or change the dev env

android: Failed to install .apk on device "device": timeout

A few days ago I started having troubles while trying to install a .apk on my Galaxy S2. I select my phone as the target, click OK and in the Console get the following error:
Failed to install AvatarRun.apk on device 'device number': timeout
Launch canceled!
Without changing anything in code and running again I can also get the error:
Failed to install AvatarRun.apk on device 'device number': device not
found com.android.ddmlib.InstallException: device not found Launch
canceled!
I have tried opening a command window and navigating to android-sdk\platform-tools and running:
adb kill-server adb start-server
This did not fix the issue.
This seems to just be a coincidence, but after failing many times I changed the minimum SDK in the Manifest from 10 to 7 and the .apk loaded on the next try, but has worked intermitently since and generates the same errors.
Can anyone suggest a method for finding what is causing this error?
After trying the fixes mentioned above, I ended up installing and reinstalling the Galaxy drivers. This didn't help. What eventually worked (so far) was to switch which USB port the Galaxy is plugged into. Once I did this everything was functioning as it should.
It may sound ridiculous, I tried all the ways suggested in Android error: Failed to install *.apk on device *: timeout
None of them works for me except unplugging the current cable and change for a new one.
There are various solutions:
Try changing the ADB connection timeout. The default is 5000; you should change it to 10000ms or so.
Window -> Preferences -> Android -> DDMS -> ADB Connection Timeout (ms)
Try to unplug and re-plug the cable. It seems that sometimes Eclipse loses the connection with Device. Sometimes you just need to plug into other USB port.
You might need to kill the ADB process and restart it.
adb kill-server and then
adb start-server
For me, the solution is to uninstall the old apk from the phone.
This problem often shows up if the computer is not fast enough. So,if you go to task manager you will see the performance. If you are watching video or running other programs at the same time while you are running your android application close other programs; at least during installing the app on device or emulator. You might even need to close internet browser.
You might need to update your computer to make it faster if you can.
Hope this helps someone:)

Categories

Resources