I have just started android and I created an app that was running fine a few days ago now I am working on another app but I am not able to run that and now I’m not even able to run the previous one.
now it's just showing Waiting for all the target devices to come online
and then it says Gradle build finished in 830ms or like that!
now it's just showing Waiting for all the target devices to come
online
To solve this-
Go to Device Manager>> Virtual and select launch AVD or from options select cold boot now.
Like Zobaer says, if it says waiting for devices that usually means the build has completed (you can check that in the Build panel) and it's waiting for the emulator to show up. If your emulator is already running, try closing it and running the app again. Otherwise if it's not getting started, try starting it yourself.
I'm just posting an answer to point out that you sometimes do need to be online for Gradle to run, but you can put it in offline mode:
That button in the popout panel, or you can always do Ctrl+Shift+A as usual and start typing what you're looking for!
When I press run and choose the device (I'm using Genymotion) it says everything went right but nothing shows up.
I also get this error message.
What should I do?
On your device go to Settings > Application.
Probably you have the app still installed for other users.
Try to find it and remove the app for all the users.
If the problem is this one you will find that app at the end of the list (in Settings > Apps > All)
All the apps marked as Not installed are still there, you can not install the same apps with Android Studio until they are there
NOTE: I haven't already had this problem personally, but I think if you click Yes in that dialog menu it should automatically remove your app/
If not, please try to follow above steps.
Hope it help
There is very awkward thing I am facing. Logcat is shown in debugging application, but while running (not debugging) application, it is not showing Logcat.
I tried restarting it but nothing is happening.
In my case in Android 2.2, for some reason, Firebase was selected by default in the dropdown box marked above. So logs didn't drop. I just needed to change it to No Filters. Then it worked.
I even tried restarting the logcat, that didn't work too. No Filters did the magic.
Hope this helps someone.
Edit:
You can as well select Show only selected application for logcat to show only the current debugging process, i.e your app.
You may be hiding it, try pressing Alt + 6 to open Log tab.
Look at the log level:- it must be verbose.
Restart adb.
If that doesn't works restart the android studio.
In Logcat window reselect your device then reselect your app
if it didn't appear restart adb using two commands:
adb kill-server
adb start-server
Besides what other guys said, look if you have written something in the search box that causes this problem(it was my case).
Note: Even in case of a restart, what you have written in search box won't delete and you need to delete it yourself.
Try the following Steps:-
Step 1.
Goto File > Invalidate Caches and Restart > Invalidate and Restart.
Android Studio will restart automatically and logcat will work as expected.
Refer screenshots :
Step 2.
If Step(1) didn't worked then try this :
Goto Terminal > cd till your platform-tools directory (eg. in Windows default location is C:\Users\\AppData\Local\Android\Sdk\platform-tools).
Now type following command :
adb kill-server
adb start-server
Step 3:
If Step(1)&(2) both didn't worked then simply try clicking on Re-Start Logging button available in Logcat option. Refer screenshot - (Green colour curved arrow with grey box)
For real device, not for the emulator:
The only thing that I did was unplug the USB cable then plugged it in again. And it worked.
First, my problem: I was testing an app on a Samsung Galaxy A3 attached via usb cable. I was getting the usual logCat messages, including the filtered ones then all of a sudden the logCat stopped displaying filtered messages. Setting it to Verbose displayed a continues stream of messages with a message at the top left corner of the logCat stating "too much output to display".
I tried restarting Android Studio (with and without clearing the cache) but no luck. I then rebooted my phone and everything was back to normal. So it appeared that the attached phone was the problem, sending too much info to the logCat.
on The top left of logcat there is an option to choose the emulator. may it's not selected the current emulator by default. try to changing it to current emulator and it will fix.
Restart both the emulator and Android Studio.
I have solved this issue by enabling "Use libusb backend" option in Android Studio -> Preferences -> Debugger -> Android Debug Bridge (adb).
Helped restart the device (HTC)
I fixed the issue by changing the USB Options of my phone from "Charging only" to "Transfer files (MTP)"
You need to press Alt+6 twice to restart the logcat window. That way it'll show the log outputs.
Go to your sdk Folder --> Platform tools --> adb click 2 times
using this adb server restart again
Please check your Sdk Location My Location is d drive Please See This
In my case when select No Filters, I see
logcat: Unexpected EOF!
then I fixed it by:
adb logcat -G 100M
See Logcat crashes with error: unexpected EOF
I had this code:
Log.e(getMyName(),message);
The problem with this was, the variable that the getter method was accessing was null. Android Studio did not give me any error about it! Seems this was silently not letting the Log.e statement to work. I checked many blogs but couldn't find the solution. This small miss wasted my complete one hour. Hope this helps someone.
I tried to switch "Extended log" in my device settings from "Selectivly" to "Allowed" and it helped. Now debug info appears in LogCat.
I had the same issue, and I resolved it by the following actions:
First, open the terminal in android studio and navigate to the following path:
C:\Users\user_name\AppData\Local\Android\Sdk\platform-tools
Second, enter the command: adb reboot.
It takes about 2 minutes, but now logcat is functioning again and showing every logcat.
This problem appeared after reinstalling (changing) GitHub in Android Studio.
it happened when I connected the GitHub Desktop (git.exe) to the Android Studio. And right after that logcat fell.
Solution: commit + push = fixed logcat))
I did not understand how it works, but it is a fact
I had the same problem. I tried killing and restarting the adb-server, but it didn't help. I deleted the debug apk of the app in the path:
<your_app>/<your_app>_app/build/outputs/apk/debug/
And run the project again. It solved the problem for me.
If your app has crashed, there is a dropdown that has 2 process, you have to select the other process that is dead, so you can see the error message:
A better approach (for ADB wifi and USB both )and it Always works Magically!
First, run the app:
Then stop before it launch the app:
You have to stop as soon as the red stop button becomes red from gray (which happens after Gradle build complete). In this way, you will start seeing logs, errors everything in the run tab. There is no need to unplug and plug USB. No need to restart ADB server.
Make sure you repeat this process until you see the logs (usually takes 1 or 2 repeats) (One request - Please upvote)
Second Master Approach:
In your emulator or android device, launch the app manually and close it manually. Then launch it from android studio.
I had the kind of issue the way which got me the logcat to work was that I was not choosing the right filter. as I was using SQLite (Database) and in filters I had chosen Firebase.so that's why my logcat was not working.
Check you don't have something in the logcat search that returns no matches, for example a non existent package name.
I had renamed my packages, but left an old name in the logcat search field.
Result: No logcat output visible
Cleaning and then Rebuilding fixed it for me. Apparently when I ran, it wasn't actually rebuilding the APK, just running the one that had already been made.
I tried all steps and debugging just to find out that I had accidently typed a space in the filter.
Make sure that in your Logcat Windows a space is not chosen as a Filter.
There will be a search bar, keep it empty. It worked in my case.
Don't do anything, if you run app in emulator or device just uninstall and reinstall the app. Done.
Try restarting ADB using the below commands:
adb kill-server
adb start-server
So I am learning Google App Engine with Java. When modifying files i realized I dont always see my changes. I try clicking the red button to stop the web application in eclipse and then restarting the application however I dont see the changes. This even happens if i run chrome in incognito mode. I also have the same problem with IE and Firefox (By default i use firefox when developing due to my preference of firebug).
Also at times I will get annoyed with one project and start a new google app engine project. However the GAE will still be running the first one not the second one even though i close the project. Even worse was when i deleted the root project folder I still saw the index.html page though the links were broken for the project i deleted.
I am thinking there are two issues one is that my browser is storing these files in a cache. And the other is that I am not actually restarting the google app engine. Is the right procedure just to click the red square in the console in eclipse or is there something to run on the command line (in windows)?
To be brief , if i want to stop the GAE from in eclipse and restart it to see any changes i made whats the easiest way to do this on windows?
Thanks
edit:
Rumor has it that adding Google Web Toolkit to the project made my App Engine launch show up in the Development Mode pane, where it could be easily be killed or restarted. Is handling this issue this way a wise idea?
Trying out this touch command idea, i was hoping there was a command line way to restart the server similar to ruby on rails
the answer by dragon in this question would be helpful if it had more detail
The red button will stop it. You shouldn't need to run anything from the command line.
What you should do though is look at "Developement Mode" view and confirm nothing is running. It's under Window-->show view -->Other--> Google. Clicking on the gray arrows will show you what is open (running or not). Also, you can press the grey Xs to clear all stopped instances. This should confirm if something is running.
Also, look under run --> run configurations -->server. You have an option to set the port, or have it automatically set. If you are trying to run more than one project, your second one may not start if the first one has already taken the port. Keep that in mind.
As far as your browser storing Dev Mode page in cache, I don't think it can. In fact, if you close the running dev mode in instance your browser page should immediately update reflecting the fact that it has lost a connection. If it doesn't, surely you didn't manage to shut it down.
Ok, so I said the red button will stop it and it will, but you have to get the right red button. If you have more than one instance running, again look at the "Developement Mode" view, there is only one red button and you have to use the grey arrows I mention to get focus on the dev mode instance you want.
It's not really that complicated and you'll have it down by tommorrow!
Here is the Dev. Mode view. You can see I have three instances. The first is actually running, but shows red as there was an error. Clicking the grey grey Xs will get rid of the second two non-running instances and clicking the document icon with one grey x (it's not greyed out), will clear the log from the current running instance and remove the red x as there would then be no errors in the log.
Got it?
I have seen this problem off and on while running the Eclipse (Galileo) under Fedora 11-13, whether the target is my device or an emulator. But now with my new device, the HTC T-Mobile G2 (Android 2.2), I see it much more frequently: I successfully download the app (complete with lots of Log.d() calls), the system successfully launches it, but the LogCat pane in the DDMS perspective is completely blank.
Sometimes, only sometimes, I seem to be able to kick it into action by clicking on the tool for Debug (the little bug one). But that doesn't even work all the time. Worse yet, it forces me to restart the whole program, which is very cumbersome.
And yes, I did remember to connect the device and make sure the device shows up under "adb devices", AND make sure that is the device the ADT downloaded to. I can even hit breakpoints in the code.
I suppose I could try relying only on the debugger, but I put a lot of work into writing those Log.d statements in the right place, it would be a giant leap backwards to do without them now. So any suggestions concerning what the problem might be, workarounds, or how to find relevant bugs logged against either ADT, SDK or the G2, would be welcome.
TIA
PS: Google searches such as "android ddms logcat" have not helped so far.
PS: I have also considered running ddms from the commandline, but the instructions on how to do this wtihout conflicting with the port already chosen by ADT for running DDMS are not clear enough to inspire confidence: so I always quit Eclipse before running the command line version of ddms. But then I lose the handy ability (provided by Eclipse) of navigating my source code while reading the log, so this too, is an inferior solution. Perhaps if someone can connect a few more of the dots in Google's instructions on this by explaining how to get the device and command-line DDMS to agree on a port while still running Eclipse, that would be a good solution.
Just to suggest the basics, when you click on the DDMS tab, is the device listed on the devices tab? (If devices isn't there, click Window->Show View->Devices) If it is listed, have you clicked on the device (on the name column). Sometimes if the device isn't clicked on it will not show the logcat.
If it is and you have selected the device - try clearing the log (the icon of a page with a red cross at the bottom right corener of it - located at the top right of the logcat panel) I find if I have had it running for a long time it sometimes fills up and stops displaying the log, although normally one line is shown.
It seems that ADT looses the connection with the device or is not re-connected when you reboot the device or emulator.
I've found that if you have more than one device or emulator you can click on the other one, click on the empty log window and the logs for this other device appear, then click the device that lost connection and will be re-connected.
Yes, sounds like black magic, but it's all we have...
It worked for me when I did following.
Remove the connection to the device (i.e. unplug the USB cable), then restart Eclipse. Next time it starts, you can see the LogCat is back on action writing logs.
Hope this helps.
I have experienced the same problem on and off.
Basically the logs were coming on console using "adb logcat" but not in the logcat view of eclipse. I've noticed that restarting the emulator , then restarting the eclipse and then relaunching the emulator from eclipse gets rid of this problem.