No matter what app I try, it won't launch on the device. It works perfectly on emulator, but when I try to launch it on the device, it'll get uploaded & installed and then "Starting activity on device " appears and nothing happens - it just sits there and does nothing. When I repeat the process, eventually it will launch (but it has to be repeated like 5-10 times), but all those activity launching processes seem to remain active, which causes my phone to lag. I tried resetting adb, reinstalling Google USB drivers, nothing helps. I have a rooted phone, and custom ROM (it's called Darky's ROM 10.2) - could that be a problem maybe?
Sometimes it takes a long time to install and run, and ADB times out. Go to preferences in Eclipse, then to Android -> DDMS -> ADB connection time out (ms), and set it to something like 30000
You can try many things:
Compile and run a sample app on handset, does it run or not? If it doesnt then there may be a compilation environment (your PC) issue, signing or something else.
Download a free app from marketplace and see if you can run it.
Is this a standard Android phone or a rooted one? if its rooted then try on a standard handet.
Before installing do "adb kill-server" and then "adb start-server" to restart the adb. This may not be useful, but, just in case.
After installing the app, can you see it in Settings -> Applications -> Manage Applications menu?
Try a hard power cycle, by removing the data cable/charger and removing the battery for 10 seconds.
Also ensure that the emulator had the same screen dimensions as the handset you are testing on.
Attach Logcat and see what shows up there.
These tests will give you better idea of what is happening.
Related
I have a new installation of Android Studio, 1.3.2. I'm new to android programming so I haven't had this installed here before, but I did have the android SDK installed a long time ago so I could root my phone via adb. Still, presumably when I installed studio and downloaded the new sdk it should've overwritten any older files I had.
My problem is that about 30 to 40 percent of the time when I'm testing my app, the entire IDE just freezes. I hit the little Play icon on the header, it loads to my phone, the phone gets the app, I can test it. Most of the time it works, sometimes I lose all ability to interact with studio. The app on the phone works fine, but nothing brings studio back. Importantly, this is NOT a Windows style "not responding" bug. I can maximize and minimize the window and drag it around without it going grey, and task manager doesn't give me the "not responding error".
It stays like this until I unplug my phone, at which point it immediately executes all of the button presses that were queued up while I was trying to click places. This makes debugging rather difficult, as I can't actually see logcat and follow along.
I do get the following errors in the ADB Logs tab whenever I plug in either of my two phones
PropertyFetcher: AdbCommandRejectedException getting properties for device 44f76320: device offline
PropertyFetcher: AdbCommandRejectedException getting properties for device 44f76320: device unauthorized.
This adbd's $ADB_VENDOR_KEYS is not set; try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
PropertyFetcher: AdbCommandRejectedException getting properties for device 44f76320: device unauthorized.
This adbd's $ADB_VENDOR_KEYS is not set; try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
DeviceMonitor: ExecutionException getting info for device 44f76320
I've revoked the USB Debugging Authorizations on both phones and confirmed via the popup dialog that I want to trust this computer, but I don't know if these errors are involved in this problem or not.
One last thing that may or may not be related: sometimes even when it doesn't entirely freeze, logcat is ridiculously unresponsive. I'll crash my program on a null pointer, and it'll take upwards of 30 seconds for the stack trace to show up (this is not, by the way, a very large program if that matters). Sometimes it never shows up at all, even though things are connected and seem to be working, I just get nothing at all in logcat.
Thoughts? Even just ideas on what to try next would be most appreciated, I'm stuck and most of my googling seems to be bringing up very different issues than the ones I'm having.
Just in case anyone else runs into this, I eventually solved it after upgrading from Windows 8.1 to Windows 10. I didn't do a fresh install, I just ran the upgrade process. When I first launched Android Studio, it had to update a few things, and one of the things it updated was the Google USB Driver. I'm willing to wager that was my problem all along, and the OS upgrade wasn't at all necessary.
So if you have this problem, try updating your USB Driver.
I've found a variety of questions here talking about solutions to the "usb device not found" problem when using adb, but I haven't found any explanations about what's going on or if there's a long term fix.
When I'm developing I'll write some code then hit run or debug, watch the results on my device then repeat the process.
Every now and then, perhaps once every few days, I'll get the "usb device not found" error.
The first thing I try is to open up the task list and kill adb.exe. That sometimes works.
If that doesn't work the next thing I try is to kill adb.exe then disconnect the android device, reboot it, then reconnect it and then run "adb usb" from the command line. That almost always works.
If the above doesn't work then I'll reboot the android device and also reboot the computer. That seems to do it for all the remaining times that the problem occurs.
Does anyone know why this happens and if there's a way to prevent it from happening? My only theory (based on not much) is that perhaps the device gets hot (due to heavy cpu usage during development and debugging) and does something wrong which messes with the way adb does things.
I had the same problem. I ended up having to go to my computer/properties/advanced system settings/environment variables/ , click "PATH" , then paste ";c:\Android\tools;c:\Android\platform-tools" as the "variable value"
then i went into device manager - my computer/properties/device manager and seeing that the droid had an "!" by it. I then downloaded and unzipped android ADB into a file on the desktop. and then back in device manager installed the driver by right clicking droid/then clicking update driver software , and selecting the file on the desktop and it, voila.
it took 20 seconds.
The emulator won't launch my apps even on a real device! I've tried every solution online, even reinstalling android sdk,ADT plugin. The app run SOMTIMES(4x to be exact) though, like awhile ago, when i got home i tried it again, and it run on my first try then i began working on the code again then i tried to run it, won't run again. Even basic apps like hello world won't run most of the time. I've set the run configuration to let me choose my device everytime, but even the device chooser wont show up(showed up once only), i tried waiting for 30 minutes(also tried the kill-server start-server) but it just wont run! my real device, or the emulator is listed on the DDMS perspective and there's nothing on console. please help, cause I've wasted 2 days for this already.
Have you also tried, taking the USB cable then disabling debugging and then enabling debugging and putting the USB cable back.
I remember this happen to me, so I did what I mentioned and surprisingly it works. Hope it work for you too.
Maybe you should try deleting your emulator and creating a new one. Make sure that all your settings are correct and that you are targeting the right OS version.
I've had quite a few problems with the emulator and wiping them and starting from scratch worked more often than not.
As for the real device, the first real hurdle is getting the right drivers so that your PC can recognize it, after that kill-server start-server usually does it. I'm surprise that didn't work for you.
I've done everything to the 'T' in regards to installing the Android SDK/ADT. I've tried all methods to resolve this (adb kill, wipe data), but still nothing.
When I run it from the SDK manager, the loading process works, but once it is done, a flash of the emulator appears then quickly disappears.
Sometimes after it loads, nothing happens.
At the worst when it loads, I get the "too many emulator instances are running on this machine. Aborting" message.
I want to start making apps, but this seems to be the only thing stopping me!
Eclipse Indigo; r12, Windows 7 (64)
If you have Windows Firewall (or another software firewall) active, try temporarily turning it off and then running the emulator. If that clears up the problem, then you need to teach the firewall how to open up the ports the emulator needs.
Go through your services and kill anything you find from it, including the java runtime, then run the AVD Manager as Admin and start the emulator from there, that should fix it.
I try to always make a habit of running Eclipse as Admin too because it's needed for the Emu to run properly.
I have a really serious problem which is preventing me from doing Android development at work, which I have a strong imperative to get fixed as quickly as possible.
So, I plug in my phone to my OS X machine. I go to the terminal and I do this:
rutski#imac:~$ adb devices
List of devices attached
3331833A243A00EC device
Now, that looks good so far. But if I do some work for a few minutes I'll eventually get an error somewhere during "adb install", and when I run "adb devices" again I see that now the device is NO LONGER THERE!
So I unplug the phone, and plug it back in. I run "adb devices" and see the device back again, expect the cycle will repeat, and it will reliably disappear after a few minutes.
But it gets better. DDMS for me is completely unusable. I open up an OS X terminal and run "ddms" from the command line. A window pops open with a device list, and my device is there. However, if I so much as click on my device, it will vanish from the list, and I'll get this in the terminal window:
08:26:05 E/EventLog: device not found
com.android.ddmlib.AdbCommandRejectedException: device not found
at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:736)
at com.android.ddmlib.AdbHelper.runLogService(AdbHelper.java:469)
at com.android.ddmlib.AdbHelper.runEventLogService(AdbHelper.java:445)
at com.android.ddmlib.Device.runEventLogService(Device.java:290)
at com.android.ddmuilib.log.event.EventLogPanel$8.run(EventLogPanel.java:454)
Yes, I've made sure that USB debugging is enabled. I've done a start-server kill-server with adb. I've rebooted both the phone and my machine several times. Nothing fixes the problem.
What the heck am I doing wrong here?
EDIT:
I just noticed that after rebooting my machine things are stable until I run an app that crashes via something like calling a method on a null object; that's when the device first vanishes from DDMS, and it is flakey forever after. Still, I'm confused about what to do here. I need to be able to debug crashes, and they will happen.