I am new to Android Studio (running the latest updated version) however I am trying to debug with Android monitor and Logcat only seems to work once then stops reporting!!!
This occurs for all my projects?!?
If i restart Logcat it just clears the messages.
I assume the emulator cannot connect to the debugger for some reason.
When I restart Android Studio logcat reports, but when I close the app running on the emulator it stops reporting.
This CANNOT be the default intentional behaviour, does this affect other people?
Many thanks for any help at all.
Simply restarting Android Studio is the best solution
By default if your close the emulator it unattaches itself from Android Studio, stops Android Monitor and logcat and doesn't reattach when starting again. If you stop it in android studio and run it again the emulator is still attached to Android monitor and logcat.
I assume the emulator cannot connect to the debugger for some reason. When I restart Android Studio logcat reports, but when I close the app running on the emulator it stops reporting. This CANNOT be the default intentional behaviour, does this affect other people? Many thanks for any help at all.
An answer to this part is that it does not sound like expected behavior of Android Studio / logcat / emulator. I am able to start and quit the app multiple times, each time logcat connects when the app begins and disconnects after. I can start the application through Android Studio or through the apps menu on the emulator. I can quit and restart the emulator.
An easy thing is double check the dropdowns along the top of the logcat display, especially the emulator, app, and filter selectors.
I once had an issue that sounded similar, with logcat not reconnecting. The issue there was my terminal and IDE were running different ADK installs and they were competing for the logcat connection. So what you describe is possible, but not the norm. Perhaps another debuggable app or connected device could cause similar confusion.
Related
I am new to Kotlin, and currently building my very first app (I am not experienced at all on the topic).
I successfully managed to customize my android phone and my android studio and achieved to launch the app I am currently working on a few times.
However, I now run into an error when trying to launch my app on my physical device. I get the following message: "Couldn't terminate the existing process for com.example.diceroller.", as if it was still running. The icons to launch/stop the app also seem to be in a state where the app is running on the device.
I have tried the following, without result:
close all running apps on the phone
reboot the phone
restart Android Studio
deactivate/reactivate USB debugging on the phone
The app does work fine on a virtual device.
Could you please give me any lead to follow to try and be able to test my app on a physical device? Thanks a lot!
Try to kill the daemon, open your terminal and write this
adb kill-server
I'm working in Android Studio, and have been happily running in normal mode and debug mode for ages. Suddenly, debug mode has stopped working for me.
If I try to click on the Debug button (the little bug with the 'play' triangle), it attempts to start in the emulator, but the app never opens.
On the emulator, I get the "Waiting for debugger" alert, and the option to "Force Close". On Android Studio itself, the debug window at the bottom repeatedly shows "Waiting for application to come online:", and then "Could not connect to remote process. Aborting debug session."
I can run it fine in normal mode. It makes no difference whether I use the debug button to start the emulator, or whether it's already open in normal mode and I use the debug button to switch to debug mode.
I've tried restarting everything, and it hasn't made any difference. Any solutions I can find online are for much older versions of Android Studio.
Any ideas what I can try? I'm working around it with lots of Logs, but that's really slow.
I seem to have resolved this by choosing the 'debug' flavour before opening the emulator. It makes sense to need to do that, but 1) it didn't work like that before and 2) if it's now required, it seems like there should be some kind of error message with more details. Hope this helps someone else, though!
I tried to kill adb.exe process and this problem resolved.
(How to restart ADB manually from Android Studio)
I am very upset about the Android Logcat.
I don't see errors when i run app from my phone.
Logcat doesn't show anything when i try to run an app, but then the app freezes on my smartphone and shuts down.
I cannot develop if logcat doesn't show me any error at all.
If the app runs corretly it will show up.
Things i did to try see an error in Logcat while developing:
Restarted computer
Restarted Android studio
Cleared every single filter from the Logcat in Android Studio
Executed adb kill-server
Uninstalled an application that i developed
I am very confused. I need to see a Logcat error to continue developing my application. At the moment i cannot continue developing. Please help me out of trouble!
Things i havent tried yet:
Reset my phone to factory settings
Have you tried to go to the device tab (where the devices and emulators are), click your device and then go to the logcat tab again?
Logcat has stopped working for me again in Android Studio. Last time it happened I had to reinstall the IDE, and I want to avoid it again.
What I did for this to happen was changing...
Log.d("WRONG", "TEST");
to
Log.d("LOG", TEST");
and then changed the tag back to "WRONG" again. Now Logcat wont show any of my debug messages even if I remove WRONG from the filter when the app is running on my phone. The emulator still provides debug messages.
I already tried:
Checked if Android Device Monitor is active.
Restarting Logcat.
Change from Verbose to Debug and back to Verbose.
Unplugging the phone.
Restarting Android Studio.
Invalidate cache / Restart (in File menu).
Uninstalling the app.
Restarting the computer.
All of the above at the same time.
Changing phone.
Switching USB cable.
Opening Android Studio Manager. It bugged out and the log told me »java.io.IOException: The folder "C:\Users\Logga%20in.android\monitor-workspace.metadata" is read-only.«
[edit: tried even more solutions]
Using the terminal in Android Studio. Going to android sdk\platform-tools folder and typing adb kill-server followed by adb start-server.
opening Dalvik Debug Monitor through Command and checking the log there.
adding android:debuggable="true" to the manifest (under the application tag).
I'm using Android Studio 2.1 but the same thing happened when I was using 2.0b.
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
Hope this helps someone.
I finally got the log to start working again.
I did some updates in Android Studio, mostly just the repositories, but what I think was the real solution was to turn off my phone and have it turned off for about fifteen minutes. After that, the log started to work again.
try this,
Remove WRONG key word which is written in log cat search.
hope it will help you.
I selected no filter, cleared logcat buffer on device and then restarted the app and changed the filter back to "show only seleced application"
this ended up working for me :)
Reboot your PC. It happens to me once i restarted my PC worked fine.
To get a particular Logs from your application. You can use Create New Logcat Filter dialog which appears after selecting Edit Filter Configuration to create your own filter. And From filter option select My Tag
Mine stopped working twice in the past few weeks but it was not just log but the functionality I was implementing wouldn't work as well. I was running my code in an emulator. The solution was to plug in my phone and run it on my phone. It worked the first time on my phone. Only after it started working there did restarting the emulator work.
I am using Android Studio 1.5.1 IDE.
I plugged up a Samsung phone to test with. Without even running the application I am testing, the LogCat constantly just scrolls data and it makes it difficult to focus on my app.
Is there a way to stop the console from showing phone debug logs and just show me my app when I am running it?
Yes, when running the application you are able to select your application in the dropdown highlighted in green here:
This causes only the output from that specific application to be shown during debugging/running.
If you're asking to never ever show the logs from your phone, I cannot help you with that.