AndroidRuntime thrashing - android

I get this series of messages about once every six or so seconds from my Android emulator's LogCat output. I haven't noticed a cause, and it doesn't always happen, but when it does, it doesn't stop until I kill the emulator. Here's the repeated message:
07-28 20:53:00.763: DEBUG/AndroidRuntime(2756): Shutting down VM
07-28 20:53:00.763: DEBUG/dalvikvm(2756): Debugger has detached; object registry had 1 entries
07-28 20:53:00.802: INFO/AndroidRuntime(2756): NOTE: attach of thread 'Binder Thread #3' failed
07-28 20:53:01.682: DEBUG/AndroidRuntime(2766): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
07-28 20:53:01.692: DEBUG/AndroidRuntime(2766): CheckJNI is ON
07-28 20:53:02.023: DEBUG/AndroidRuntime(2766): --- registering native functions ---
07-28 20:53:05.083: DEBUG/AndroidRuntime(2766): Shutting down VM
Does anyone have a clue WTF is going on here?

Looks like one of the framework-interaction shell commands is being launched repeatedly. If you type "adb shell am" you'll see similar output in the log file. Something in your development environment is going nutty.
Are you using Windows or Linux? Eclipse? The Android ADT plugin?
You can try "adb kill-server" to see if that's enough of a reset to stop whatever is going batty.

Related

Debug Android zygote process

I'm studying Android system startup and am very interested in the zygote process. Is there anyway to debug zygote with gdb or other tools? I've tried to do it with virtual machine like VMware or qemu but failed, all google results are about kernel debugging. By debug I mean I could set breakpoint, step into, check register value, etc... with gdb just like the normal process debugging with gdb.
I post this question and after several tries. I found one way to debug daemon processes as long as it started after adbd:
Stop zygote
Gdbserver attach init process
Restart zygote
Debug its child process

Unable to debug with dual debugger on Nokia 7.1

I'm trying to debug NDK application on my Nokia 7.1 from Android Studio (3.4.1) but I'm getting this error:
Error running 'app': Unable to open debugger port (localhost:8600): java.io.IOException
I can connect to device with ndk, run app without debugging and even debug application using Java debugger (Run/Debug configurations -> Debugger -> Debug type: Java). Also debugging application C code is working on another phone (CAT S60).
First I was thinking about debugger connection timeout, so I increased it to 500000ms. This didn't help.
Attaching to running process is working but only Java or only Native debugger. Dual debugger failed to connect Java part and application is waiting for debugger.
Here is message from debugger console:
Debugger attached to process 29042
Timed out waiting for java debugger to attach
Process finished with exit code 0
Does anybody have experience how to run dual debugger on Nokia 7.1?

Android emulator stuck in boot loop -library "/system/lib/libnetcmdiface.so" not found

I have tried to boot my emulator on three different platforms windows 7, ubuntu 12.04 and kubuntu 13.10(fresh install). However it always stops here with the logcat looping with the output below.
Could anyone help me figure this out. It is quite frustrating and I have lost close to a week of development.
D/AndroidRuntime( 3143): >>>>>> AndroidRuntime START com.android.internal.os.ZygoteInit <<<<<<
D/AndroidRuntime( 3143): CheckJNI is ON
E/dalvikvm( 3143): Can't create markStack
W/dalvikvm( 3143): CreateJavaVM failed: dvmGcStartup failed
E/AndroidRuntime( 3143): JNI_CreateJavaVM failed
I/Netd ( 3161): Netd 1.0 starting
W/InterfaceController( 3161): Warning (dlopen failed: library "/system/lib/libnetcmdiface.so" not found) while opening the net interface command library
D/AndroidRuntime( 3162):
I run into similar issue when I replaced libcrypto.so with my version. As restored /system/lib/libcrypto.so with original copy, things worked fine.
This happened unexpectedly on my Android 12 emulator. It would no longer boot up, and instead just get stuck on the black screen that has the word "android" in white letters, with a gray fade animation over the letters.
The logcat output would just have repeated displays of this every 10 seconds or so:
E/AndroidRuntime( 3143): JNI_CreateJavaVM failed
I couldn't find a way to fix it, so I just deleted the emulator and recreated it again, in Android Studio -> Tools -> Device Manager -> Create Device -> select a suitable screen size and a name -> Next -> press the tab "x86 Images" -> then select the Android 12 API 31 image that you have already downloaded.

Eclipse debugger not working with Android appWidget application?

I have an appWidget project I've been working on and noticed the Eclipse debugger does not seem to be working. I thought it might be borked, so I opened up another Android project and set a breakpoint and it worked fine. In my appWidget application however, the debugger will not work no matter where I set the breakpoint. I can set the breakpoint right on a Log statement, see the message print, but there is no interruption of execution.
I read something about having to install the 'Android sources' but it seems to me that if the debugger was missing something, it wouldn't work at all. The only clue I have is Logcat is printing "Debugger has detached" which offers little help. Other posts have suggested two Eclipse processes running (ps -ef shows only one), restarting adb (I've done adb kill-server; adb start-server) or that the process crashed, which Logcat does not show:
5486 AndroidRuntime D
5486 AndroidRuntime D >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
5486 AndroidRuntime I Heap size: -Xmx48m
5486 AndroidRuntime D CheckJNI is OFF
5486 dalvikvm D creating instr width table
5486 AndroidRuntime D Calling main entry com.android.commands.pm.Pm
5486 AndroidRuntime D Shutting down VM
5486 dalvikvm D GC_CONCURRENT freed 103K, 70% free 307K/1024K, external 0K/0K, paused 0ms+0ms
5486 dalvikvm D Debugger has detached; object registry had 1 entries
5486 AndroidRuntime I NOTE: attach of thread 'Binder Thread #1' failed
That's all Logcat says when I launch the application in debug mode. Any thoughts?

Android Eclipse failing to debug

Debugging of my app is now suddenly broken. It has been fine up to now and I even reloaded a known good version of my entire code and it still fails to debug or even run. When I hit debug or run the app starts up and right when it is about to display the app, it crashes (before even entering the main view). I have a break point on the first line of code and it never even reaches it. It just goes to Source not found - The source attachment does not contains the source for the file DexFile.class.....
I am 100% certain all the code I have loaded is working, as it is a saved backup which was saved when last working.
Also, what is odd is that if I unplug the cable at this point, the app loads normally and works fine. So this is definitely a debugging issue. It is getting stuck somewhere at boot. I have restarted my computer and phone several times to no avail.
LogCat:
`04-04 11:17:33.462: DEBUG/AndroidRuntime(4148): CheckJNI is OFF
04-04 11:17:33.462: DEBUG/dalvikvm(4148): creating instr width table
04-04 11:17:33.502: DEBUG/AndroidRuntime(4148): --- registering native functions ---
04-04 11:17:33.712: DEBUG/AndroidRuntime(4148): Shutting down VM
04-04 11:17:33.712: DEBUG/dalvikvm(4148): Debugger has detached; object registry had 1 entries
04-04 11:17:33.712: INFO/AndroidRuntime(4148): NOTE: attach of thread 'Binder Thread #3' failed
04-04 11:17:33.902: DEBUG/AndroidRuntime(4157): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
04-04 11:17:33.902: DEBUG/AndroidRuntime(4157): CheckJNI is OFF
04-04 11:17:33.902: DEBUG/dalvikvm(4157): creating instr width table
04-04 11:17:33.942: DEBUG/AndroidRuntime(4157): --- registering native functions ---
04-04 11:17:34.152: INFO/Process(107): Sending signal. PID: 4137 SIG: 9
04-04 11:17:34.152: INFO/ActivityManager(107): Force stopping package org.scanner uid=10110
04-04 11:17:34.162: ERROR/ActivityManager(107): fail to set top app changed!
04-04 11:17:34.182: INFO/UsageStats(107): Unexpected resume of com.htc.launcher while already resumed in org.scanner
04-04 11:17:34.192: INFO/ActivityManager(107): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=org.obdscanner/.activity.ObdReaderMainActivity }
04-04 11:17:34.202: DEBUG/AndroidRuntime(4157): Shutting down VM
04-04 11:17:34.202: DEBUG/dalvikvm(4157): Debugger has detached; object registry had 1 entries
04-04 11:17:34.212: INFO/AndroidRuntime(4157): NOTE: attach of thread 'Binder Thread #3' failed
04-04 11:17:34.222: WARN/InputManagerService(107): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#464105d8
04-04 11:17:34.242: INFO/ActivityManager(107): Start proc org.scanner for activity org.obdscanner/.activity.ReaderMainActivity: pid=4165 uid=10110 gids={3003, 3002}
04-04 11:17:34.332: WARN/ActivityThread(4165): Application org.scanner is waiting for the debugger on port 8100...
04-04 11:17:34.332: INFO/System.out(4165): Sending WAIT chunk
04-04 11:17:34.352: INFO/dalvikvm(4165): Debugger is active
04-04 11:17:34.472: DEBUG/Norton Community Watch/smrsd(3910): smrsd broadcast intent success!
04-04 11:17:34.512: ERROR/(3910): /data/data/com.symantec.monitor/app_log_item/1301930254.txt//data/data/com.symantec.monitor/app_log_item
04-04 11:17:34.542: INFO/System.out(4165): Debugger has connected
04-04 11:17:34.542: INFO/System.out(4165): waiting for debugger to settle...
04-04 11:17:34.632: INFO/global(3898): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
04-04 11:17:34.742: INFO/System.out(4165): waiting for debugger to settle...
04-04 11:17:34.862: DEBUG/dalvikvm(3898): GC_FOR_MALLOC freed 4492 objects / 274560 bytes in 41ms
04-04 11:17:34.942: INFO/System.out(4165): waiting for debugger to settle...
04-04 11:17:35.142: INFO/System.out(4165): waiting for debugger to settle...
04-04 11:17:35.342: INFO/System.out(4165): waiting for debugger to settle...
04-04 11:17:35.552: INFO/System.out(4165): waiting for debugger to settle...
04-04 11:17:35.752: INFO/System.out(4165): waiting for debugger to settle...
04-04 11:17:35.952: INFO/System.out(4165): waiting for debugger to settle...
04-04 11:17:36.157: INFO/System.out(4165): debugger has settled (1451)
04-04 11:17:37.296: DEBUG/dalvikvm(4165): threadid=1: still suspended after undo (sc=1 dc=1 s=Y)
`
Please see the correct annswer HERE
You have set a break point in one of the classes. Just take off all the break points in your project and run again, their will be no problem.
Eclipse->Window->Show View->(Other->Debug->)Breakpoints
Occasionally Eclipse and the various Android development plug-ins will become out of sync. I usually attempt the following when debugging / development gets "funky"
If your Logcat is not displaying lines, clear it. It has a small buffer. Also ensure that your device is selected in the "DDMS" perspective. If you have the emulator selected you will only receive logging from it.
Clean and Rebuild all open projects. Ensure there are no errors.
Uninstall the application from the remote device/emulator.
Restart Eclipse!
Open a terminal on your platform and use the tool adb in the "platform-tools" directory.
adb kill-server
adb start-server
Stash your working copy and revert your source code if using a repository.
Strange solution...I just closed the project from package explorer, then removed it from the workspace. Closed Eclipse. Re-opened Eclipse and imported the project.
(Copy and pasted from Jesse's comment.)
I tried all of the above, but i turned out that it was not working due to multiple instances of eclipse.exe
Killing them all in the task manager (CTRL+SHIFT+ESC) solved it.
On your Android device (or emulator) go to:
Applications - Settings - Applications - Manage applications - All
There you have to select your app and uninstall it.
Afterwards try to run your app from the IDE again. It should work now.
Create a new debug configuration of type Remote Java Application and set it to localhost and the port you see on the DDMS window.
https://stackoverflow.com/a/13421917/624109
I know this is kind of late.... use it if #Sam's or #Killesk's answers do not work.
ensure the manifest sets android:debuggable.
In onCreate, add a call to Debug.waitForDebugger.
Adding the call to waitForDebugger also works when reversing. For example you can add the following by hand in onCreate and have smali/baksmali recompile it:
invoke-static {}, Landroid/os/Debug;->waitForDebugger()V
I don't have to use the tricks often, but when I do, waitForDebugger always works. I don't recall a time I could not snap the debugger with it.
I've had this happen due to my code being obfuscated. I didn't notice that someone had changed proguard.cfg for a production release and commented-out the "-dontobfuscate" line.

Categories

Resources