Android app keeps crashing on launch with no good reason - android

I've been trying to figure this out for days, to no avail. I'm developing a simple android app with Titanium that works perfectly fine on iOS. Yet, when I launch it on android, it never starts. Here is my manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tiki.signals" android:versionCode="1"
android:versionName="1">
<uses-sdk android:minSdkVersion="8" />
<!-- TI_MANIFEST -->
<application android:icon="#drawable/appicon"
android:label="Signals" android:name="SignalsApplication"
android:debuggable="false">
<!-- TI_APPLICATION -->
<activity android:name=".SignalsActivity"
android:label="Signals" android:theme="#style/Theme.Titanium"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="ti.modules.titanium.facebook.FBActivity"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
/>
<activity android:name="org.appcelerator.titanium.TiActivity"
android:configChanges="keyboardHidden|orientation" />
<activity android:name="org.appcelerator.titanium.TiTranslucentActivity"
android:configChanges="keyboardHidden|orientation"
android:theme="#android:style/Theme.Translucent" />
<activity android:name="org.appcelerator.titanium.TiModalActivity"
android:configChanges="keyboardHidden|orientation"
android:theme="#android:style/Theme.Translucent" />
<activity android:name="ti.modules.titanium.ui.TiTabActivity"
android:configChanges="keyboardHidden|orientation" />
<activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity" />
<service android:name="org.appcelerator.titanium.analytics.TiAnalyticsService"
android:exported="false" />
</application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
</manifest>
Here's the logcat:
I/ActivityManager( 81): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.tiki.signals/.SignalsActivity} from pid 176
D/PermissionCache( 35): checking android.permission.READ_FRAME_BUFFER for uid=1000 => granted (1163 us)
D/dalvikvm( 81): GC_FOR_ALLOC freed 842K, 14% free 11108K/12807K, paused 106ms
I/dalvikvm-heap( 81): Grow heap (frag case) to 12.385MB for 1536016-byte allocation
D/dalvikvm( 81): GC_FOR_ALLOC freed 1K, 13% free 12606K/14343K, paused 105ms
W/WindowManager( 81): Failure taking screenshot for (180x300) to layer 21005
I/ActivityManager( 81): Start proc com.tiki.signals for activity com.tiki.signals/.SignalsActivity: pid=457 uid=10040 gids={1015, 3003}
I/dalvikvm( 457): Turning on JNI app bug workarounds for target SDK version 8...
W/NetworkManagementSocketTagger( 81): setKernelCountSet(10040, 1) failed with errno -2
D/dalvikvm( 81): GC_CONCURRENT freed 13K, 13% free 12619K/14343K, paused 8ms+32ms
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
I/TiApplication( 457): (main) [0,0] checkpoint, app created.
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
D/dalvikvm( 457): GC_CONCURRENT freed 243K, 4% free 9294K/9607K, paused 7ms+6ms
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
I/TiApplication( 457): (main) [682,682] Titanium 1.8.2 (2012/02/23 17:46 59b3a90)
D/dalvikvm( 457): GC_CONCURRENT freed 422K, 5% free 9434K/9927K, paused 6ms+4ms
I/TiApplication( 457): (main) [254,936] Titanium Javascript runtime: v8
D/dalvikvm( 457): Trying to load lib /data/data/com.tiki.signals/lib/libstlport_shared.so 0x412a1e60
D/dalvikvm( 457): Added shared lib /data/data/com.tiki.signals/lib/libstlport_shared.so 0x412a1e60
D/dalvikvm( 457): No JNI_OnLoad found in /data/data/com.tiki.signals/lib/libstlport_shared.so 0x412a1e60, skipping init
D/dalvikvm( 457): Trying to load lib /data/data/com.tiki.signals/lib/libkroll-v8.so 0x412a1e60
I/TiRootActivity( 457): (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
D/dalvikvm( 457): Added shared lib /data/data/com.tiki.signals/lib/libkroll-v8.so 0x412a1e60
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
E/TiApplication( 457): (KrollRuntimeThread) [3551,3551] APP PROXY: ti.modules.titanium.app.AppModule#41334e08
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
D/dalvikvm( 457): GC_CONCURRENT freed 349K, 5% free 9566K/10055K, paused 7ms+6ms
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
D/dalvikvm( 457): GC_FOR_ALLOC freed 452K, 7% free 9534K/10183K, paused 84ms
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
D/TiLocation( 457): (main) [2290,5841] preferredProvider property found [null]
D/TiLocation( 457): (main) [1,5842] accuracy property found [0]
E/TiLocationHelper( 457): (main) [31,5873] unable to register, provider is null
D/dalvikvm( 457): GC_FOR_ALLOC freed 105K, 7% free 9571K/10183K, paused 61ms
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
I/dalvikvm-heap( 457): Grow heap (frag case) to 10.878MB for 1536016-byte allocation
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
D/dalvikvm( 457): GC_CONCURRENT freed 1K, 6% free 11070K/11719K, paused 8ms+5ms
I/TiRootActivity( 457): (main) [0,0] checkpoint, on root activity resume. activity = com.tiki.signals.SignalsActivity#412aba88
V/PhoneStatusBar( 134): setLightsOn(true)
I/Process ( 81): Sending signal. PID: 457 SIG: 3
I/dalvikvm( 457): threadid=3: reacting to signal 3
W/InputManagerService( 81): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy#41434cb8 (uid=10013 pid=176)
I/dalvikvm( 457): Wrote stack traces to '/data/anr/traces.txt'
D/gralloc_goldfish( 457): Emulator without GPU emulation detected.
I/ActivityManager( 81): Displayed com.tiki.signals/.SignalsActivity: +9s553ms
W/NetworkManagementSocketTagger( 81): setKernelCountSet(10013, 0) failed with errno -2
D/ExchangeService( 355): Received deviceId from Email app: androidc259148960
D/ExchangeService( 355): Reconciling accounts...
D/dalvikvm( 81): GC_EXPLICIT freed 1712K, 23% free 11125K/14343K, paused 7ms+11ms
W/ThrottleService( 81): unable to find stats for iface rmnet0
W/TiAnalyticsSvc( 457): (Thread-65) [23787,23787] Analytics Service Started
I/TiAnalyticsSvc( 457): (Thread-65) [152,23939] Sending 2 analytics events.
W/TiAnalyticsSvc( 457): (Thread-65) [1072,25011] Stopping Analytics Service
Here's my tiapp.xml:
<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
<property name="ti.android.runtime">v8</property>
<property name="ti.android.threadstacksize" type="int">132768</property>
<property name="ti.android.fastdev" type="bool">false</property>
<sdk-version>1.8.2</sdk-version>
<deployment-targets>
<target device="mobileweb">false</target>
<target device="iphone">true</target>
<target device="ipad">true</target>
<target device="android">true</target>
<target device="blackberry">false</target>
</deployment-targets>
<id>com.tiki.signals</id>
<name>Signals</name>
<version>1.0</version>
<publisher>Michael</publisher>
<url>http://</url>
<description>not specified</description>
<copyright>2012 by meilers</copyright>
<icon>appicon.png</icon>
<persistent-wifi>false</persistent-wifi>
<prerendered-icon>false</prerendered-icon>
<statusbar-style>default</statusbar-style>
<statusbar-hidden>false</statusbar-hidden>
<fullscreen>false</fullscreen>
<navbar-hidden>false</navbar-hidden>
<analytics>true</analytics>
<guid>49aefe11-b922-4f04-bffd-887ed59cb5d3</guid>
<iphone>
<orientations device="iphone">
<orientation>Ti.UI.PORTRAIT</orientation>
</orientations>
<orientations device="ipad">
<orientation>Ti.UI.PORTRAIT</orientation>
<orientation>Ti.UI.UPSIDE_PORTRAIT</orientation>
<orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
<orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
</orientations>
</iphone>
<android xmlns:android="http://schemas.android.com/apk/res/android"/>
<modules/>
</ti:app>
What is happening here? I don't see any error in logcat. The VM is just shutting down, with no reason. Please help!

One item comes to mind just looking at the logcat... Not enough memory. You'll see memory free dip to 3% YIKES!. Usually try to keep 10% free or OS may go into a paging fit and possible time out some features.
Disable some features in the app and watch the memory under the emulator.
Best recommendation install the app onto actual phone, though the emulator is supposed to give close tor real world results. Which I dont count on emulating any hardware device well.
Here's some code to dump memory usage. You need to find out what your target class is.
Older phones have as little as 16MB newer ones 48MB before the OS starts picking on your app. Put code in Oncreate.
Runtime rt = Runtime.getRuntime();
long maxMemory = rt.maxMemory();
Log.v("onCreate", "maxMemory:>>>>>" + Long.toString(maxMemory)); //max available memory to use
ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
int memoryClass = am.getMemoryClass();
Log.v("onCreate", "memoryClass:>>>>" + Integer.toString(memoryClass)); //max available you should use to keep from getting bumped off
printl("PGM MEM FREE MB", GetInternalMemAvail());
printl("INTERNAL STORAGE FREE MEMORY BYTES",getmem());
printl("INTERNAL TOTAL MEMORY BYTES",TotalMemory());
printl("SD MEM FREE MB",GetSDMemAvail());
printl("SD MEM GB",getAvailableSpaceInGB());
private static void printl(String printstring,long x)
{
String temp;
temp=String.format(" %d",x);
Log.e(printstring,temp);
}

Related

Android "Shutting down VM" with no stacktrace

I have recently faced this issue a lot and I am not able to find any solution to it.
I am constantly getting Shutting down VM and logcat doesn't show any trace of this issue.
06-08 20:34:25.288 20416-20416/my.package.dev D/app_BaseRecyclerView﹕ onCreateViewHolder begins
06-08 20:34:25.324 20416-20416/my.package.dev D/AndroidRuntime﹕ Shutting down VM
06-08 20:34:30.969 20416-20425/my.package.dev I/art﹕ Thread[5,tid=20425,WaitingInMainSignalCatcherLoop,Thread*=0xb4a33800,peer=0x12c000a0,"Signal Catcher"]: reacting to signal 3
06-08 20:34:30.969 20416-20425/my.package.dev I/art﹕ [ 06-08 20:34:31.169 617: 639 I/Process ]
Sending signal. PID: 617 SIG: 3
Do you know how to make the stacktrace visible?
If you are using Google Analytics, try to disable ExceptionReporting if it is set to true

Fail to add Spongycastle as provider in android

I am trying to make use of spongycastle and followed all the help I could get to include it but when the application execute it crashes at the code where I add it as a provider:
static {
Security.addProvider(new org.spongycastle.jce.provider.BouncyCastleProvider());
}
I add scprov-jdk15-1.46.99.3-UNOFFICIAL-ROBERTO-RELEASE.jar as an external JAR to my project and eclipse does not report any errors.
Any ideas?
The stacktrace:
08-11 12:41:56.653: W/ActivityThread(683): Application com.ljbrits.test4 is waiting for the debugger on port 8100...
08-11 12:41:56.723: I/System.out(683): Sending WAIT chunk
08-11 12:41:56.723: I/dalvikvm(683): Debugger is active
08-11 12:41:56.914: I/System.out(683): Debugger has connected
08-11 12:41:56.914: I/System.out(683): waiting for debugger to settle...
08-11 12:41:57.113: I/System.out(683): waiting for debugger to settle...
08-11 12:41:57.153: I/dalvikvm(683): threadid=3: reacting to signal 3
08-11 12:41:57.203: I/dalvikvm(683): Wrote stack traces to '/data/anr/traces.txt'
:
08-11 12:41:59.344: I/System.out(683): waiting for debugger to settle...
08-11 12:41:59.546: I/System.out(683): debugger has settled (1437)
08-11 12:41:59.693: I/dalvikvm(683): threadid=3: reacting to signal 3
08-11 12:41:59.824: I/dalvikvm(683): Wrote stack traces to '/data/anr/traces.txt'
08-11 12:42:00.173: I/dalvikvm(683): threadid=3: reacting to signal 3
08-11 12:42:00.183: I/dalvikvm(683): Wrote stack traces to '/data/anr/traces.txt'
08-11 12:42:00.193: D/dalvikvm(683): threadid=1: still suspended after undo (sc=1 dc=1)
08-11 12:42:00.283: E/dalvikvm(683): Could not find class 'org.spongycastle.jce.provider.BouncyCastleProvider', referenced from method com.ljbrits.test4.Test4Activity.<clinit>
08-11 12:42:00.283: W/dalvikvm(683): VFY: unable to resolve new-instance 417 (Lorg/spongycastle/jce/provider/BouncyCastleProvider;) in Lcom/ljbrits/test4/Test4Activity;
08-11 12:42:00.283: D/dalvikvm(683): VFY: replacing opcode 0x22 at 0x0000
08-11 12:42:00.363: D/dalvikvm(683): DexOpt: unable to opt direct call 0x07d8 at 0x02 in Lcom/ljbrits/test4/Test4Activity;.<clinit>
08-11 12:42:00.683: I/dalvikvm(683): threadid=3: reacting to signal 3
08-11 12:42:00.714: D/dalvikvm(683): threadid=1: still suspended after undo (sc=1 dc=1)
08-11 12:42:00.714: I/dalvikvm(683): Wrote stack traces to '/data/anr/traces.txt'
:
08-11 12:42:06.233: I/dalvikvm(683): Wrote stack traces to '/data/anr/traces.txt'
08-11 12:42:08.719: W/dalvikvm(683): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/ljbrits/test4/Test4Activity;
08-11 12:42:08.719: W/dalvikvm(683): Class init failed in newInstance call (Lcom/ljbrits/test4/Test4Activity;)
The NoClassDefFoundError thrown here suggests that the SpongyCastle classes are not being included in your deployed apk file - try unzipping the apk to check this). This could be caused by a few things, make sure you do a clean build (are you builiding with ant or eclipse?) and if the problem persists, it's likely a proguard issue - ProGuard may be stripping out classes it thinks are unused - could you post your proguard.cfg?

Camera not responding

I am using the built in camera app in android using intents like this:
final Button Capture=(Button)findViewById(sankalp.jain.sky.R.id.capture);
Capture.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Uri fileUri;
final Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
Log.w("intent","for camera");//displayed
fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create a file to save the image
Log.w("getoutput","getit");//displayed
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the image file name
Log.w("hello","hello the 2nd step");//displayed
startActivityForResult(intent,CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
}
I have implemented the relevant getOutputMediafile() method and the image gets saved in /mnt/sdcard/Pictures/Samarth/chart.png
The sdcard is 40MB and there are only 2 files presently totaling some 100KB.
The problem is that the camera works perfectly for some random number of snaps and then randomly hangs and then gives an ANR.
Its totally random,restarting the emulator doesnt work and sometimes it does.
Here is the logcat output
LOGCAT:
I/ActivityManager( 70): Displayed sankalp.jain.sky/.Tabinit: +1s364ms
W/intent ( 596): for camera
D/path ( 596): /mnt/sdcard/Pictures/Samarth
W/getoutput( 596): getit
W/hello ( 596): hello the 2nd step
I/ActivityManager( 70): Starting: Intent { act=android.media.action.IMAGE_CAPT
URE cmp=com.android.camera/.Camera (has extras) } from pid 596
D/PhoneWindow( 596): couldn't save which view has focus because the focused vie
w com.android.internal.policy.impl.PhoneWindow$DecorView#4056d7e0 has no id.
I/WindowManager( 70): Setting rotation to 1, animFlags=1
I/ActivityManager( 70): Config changed: { scale=1.0 imsi=310/260 loc=en_US tou
ch=3 keys=2/1/2 nav=3/1 orien=2 layout=34 uiMode=17 seq=13}
V/CameraHolder( 411): open camera 0
D/CameraHardwareStub( 34): initHeapLocked: preview size=320x240
I/StagefrightPlayer( 34): setDataSource('/system/media/audio/ui/camera_click.o
gg')
I/StagefrightPlayer( 34): setDataSource('/system/media/audio/ui/VideoRecord.og
g')
D/Camera ( 411): app passed NULL surface
D/CameraHardwareStub( 34): initHeapLocked: preview size=320x240
V/camera ( 411): startPreview
I/ActivityManager( 70): Displayed com.android.camera/.Camera: +1s198ms
W/OrientationEventListener( 411): Cannot detect sensors. Not enabled
E/SurfaceFlinger( 70): texture=10, using format 17, which is not supported by
the GL
V/GLRootView( 411): onSurfaceChanged: 627x470, gl10: com.google.android.gles_jn
i.GLImpl#40511140
V/GLRootView( 411): layout content pane 627x470
W/IInputConnectionWrapper( 596): showStatusIcon on inactive InputConnection
D/dalvikvm( 70): GC_EXPLICIT freed 130K, 47% free 4929K/9159K, external 3511K/
4385K, paused 795ms
V/camera ( 411): Start autofocus.
D/dalvikvm( 411): GC_EXTERNAL_ALLOC freed 34K, 51% free 2932K/5895K, external 2
480K/2565K, paused 697ms
V/camera ( 411): mAutoFocusTime = 1622ms
V/camera ( 411): doSnap: mFocusState=3
D/CameraHardwareStub( 34): initHeapLocked: preview size=320x240
D/dalvikvm( 596): GC_EXPLICIT freed 209K, 49% free 2870K/5575K, external 3065K/
3507K, paused 650ms
D/SntpClient( 70): request time failed: java.net.SocketException: Address fami
ly not supported by protocol
I/InputDispatcher( 70): Application is not responding: Window{40751af8 com.and
roid.camera/com.android.camera.Camera paused=false}. 5014.6ms since event, 5014
.0ms since wait started
I/WindowManager( 70): Input event dispatching timed out sending to com.android
.camera/com.android.camera.Camera
I/Process ( 70): Sending signal. PID: 411 SIG: 3
I/dalvikvm( 411): threadid=4: reacting to signal 3
I/dalvikvm( 411): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 70): Sending signal. PID: 70 SIG: 3
I/dalvikvm( 70): threadid=4: reacting to signal 3
I/dalvikvm( 70): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 70): Sending signal. PID: 340 SIG: 3
I/dalvikvm( 340): threadid=4: reacting to signal 3
I/dalvikvm( 340): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 70): Sending signal. PID: 115 SIG: 3
I/dalvikvm( 115): threadid=4: reacting to signal 3
I/dalvikvm( 115): Wrote stack traces to '/data/anr/traces.txt'
D/dalvikvm( 70): GC_EXPLICIT freed 354K, 45% free 5052K/9159K, external 3511K/
4385K, paused 157ms
E/ActivityManager( 70): ANR in com.android.camera (com.android.camera/.Camera)
E/ActivityManager( 70): Reason: keyDispatchingTimedOut
E/ActivityManager( 70): Load: 0.12 / 0.23 / 0.25
E/ActivityManager( 70): CPU usage from 42677ms to 0ms ago:
E/ActivityManager( 70): 0.3% 70/system_server: 0.1% user + 0.1% kernel / fau
lts: 5 minor
E/ActivityManager( 70): 0.3% 115/com.android.systemui: 0.2% user + 0% kernel
/ faults: 4 minor
E/ActivityManager( 70): 0.1% 340/com.android.phone: 0% user + 0% kernel / fa
ults: 4 minor
E/ActivityManager( 70): 0% 34/mediaserver: 0% user + 0% kernel
E/ActivityManager( 70): 0% 32/rild: 0% user + 0% kernel
E/ActivityManager( 70): 0% 41/adbd: 0% user + 0% kernel
E/ActivityManager( 70): 1.1% TOTAL: 0.7% user + 0.4% kernel
E/ActivityManager( 70): CPU usage from 1031ms to 1675ms later:
E/ActivityManager( 70): 10% 70/system_server: 6.2% user + 4.6% kernel
E/ActivityManager( 70): 10% 100/InputDispatcher: 7.8% user + 3.1% kernel
E/ActivityManager( 70): 34% TOTAL: 17% user + 17% kernel
I/InputDispatcher( 70): Dropping event because the pointer is not down.
D/dalvikvm( 115): GC_CONCURRENT freed 365K, 49% free 2977K/5831K, external 2169
K/2674K, paused 9ms+6ms
D/SntpClient( 70): request time failed: java.net.SocketException: Address fami
ly not supported by protocol
W/ProcessStats( 70): Skipping unknown process pid 734
W/ProcessStats( 70): Skipping unknown process pid 735
V/BackupManagerService( 70): Backup requested but nothing pending
D/SntpClient( 70): request time failed: java.net.SocketException: Address fami
ly not supported by protocol
I/EventLogService( 266): Aggregate from 1332336498594 (log), 1332336498594 (dat
a)
D/dalvikvm( 266): GC_EXPLICIT freed 61K, 55% free 3085K/6727K, external 1625K/2
137K, paused 296ms
I could never figure out the reason myself but due to some problems when I decided to upgrade the emulator to Google API15(from API10) the camera doesn't hang anymore.
Upgrading also rectified some weird problems like
Force portrait mode in camera
Hope that helps someone.

Hit a button on Android and takes a long response time

First, I use a System.Out.print to output something but I don't see that in the console or logcat, where does it display?
Then when hit the button, it takes long time to respond. I log the files from logcat and have No idea what the OS is doing behind which took so long.
02-16 13:01:07.859: WARN/WindowManager(51): Key dispatching timed out sending to com.test.finalapp/com.test.finalapp.tab.FeaturedActivity
02-16 13:01:08.101: WARN/WindowManager(51): Dispatch state: {{KeyEvent{action=1 code=4 repeat=0 meta=0 scancode=158 mFlags=8} to Window{44dcd868 com.test.finalapp/com.test.finalapp.MyAccount1_1Activity paused=false} # 1329425383564
lw=Window{44dcd868 com.test.finalapp/com.test.finalapp.MyAccount1_1Activity paused=false} lb=android.os.BinderProxy#44e756f0 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{44e2b0a0 com.test.finalapp/com.test.finalapp.games.slotMachine paused=false}}}
02-16 13:01:08.119: WARN/WindowManager(51): Current state: {{null to Window{44e2c788 com.test.finalapp/com.test.finalapp.tab.FeaturedActivity paused=false} # 1329426068120 lw=Window{44e2c788 com.test.finalapp/com.test.finalapp.tab.FeaturedActivity paused=false} lb=android.os.BinderProxy#44e2c5a0 fin=true gfw=true ed=true tts=0 wf=false fp=false mcf=Window{44e2b0a0 com.test.finalapp/com.test.finalapp.games.slotMachine paused=false}}}
02-16 13:01:08.240: INFO/ActivityManager(51): ANR in process: com.test.finalapp (last in com.test.finalapp)
02-16 13:01:08.240: INFO/ActivityManager(51): Annotation: keyDispatchingTimedOut
02-16 13:01:08.240: INFO/ActivityManager(51): CPU usage:
02-16 13:01:08.240: INFO/ActivityManager(51): Load: 0.37 / 0.37 / 0.38
02-16 13:01:08.240: INFO/ActivityManager(51): CPU usage from 8216ms to 81ms ago:
02-16 13:01:08.240: INFO/ActivityManager(51): system_server: 4% = 3% user + 1% kernel / faults: 4 minor
02-16 13:01:08.240: INFO/ActivityManager(51): obango.finalapp: 0% = 0% user + 0% kernel
02-16 13:01:08.240: INFO/ActivityManager(51): qemud: 0% = 0% user + 0% kernel
02-16 13:01:08.240: INFO/ActivityManager(51): logcat: 0% = 0% user + 0% kernel
02-16 13:01:08.240: INFO/ActivityManager(51): events/0: 0% = 0% user + 0% kernel
02-16 13:01:08.240: INFO/ActivityManager(51): TOTAL: 5% = 4% user + 1% kernel
02-16 13:01:08.251: INFO/ActivityManager(51): Removing old ANR trace file from /data/anr/traces.txt
02-16 13:01:09.081: INFO/Process(51): Sending signal. PID: 239 SIG: 3
02-16 13:01:09.239: INFO/dalvikvm(239): threadid=7: reacting to signal 3
02-16 13:01:09.458: INFO/Process(51): Sending signal. PID: 51 SIG: 3
02-16 13:01:09.486: INFO/dalvikvm(51): threadid=7: reacting to signal 3
02-16 13:01:10.457: INFO/dalvikvm(239): Wrote stack trace to '/data/anr/traces.txt'
02-16 13:01:12.037: INFO/dalvikvm(51): Wrote stack trace to '/data/anr/traces.txt'
02-16 13:01:12.055: INFO/Process(51): Sending signal. PID: 223 SIG: 3
02-16 13:01:12.269: INFO/dalvikvm(223): threadid=7: reacting to signal 3
02-16 13:01:12.358: INFO/Process(51): Sending signal. PID: 213 SIG: 3
02-16 13:01:12.375: INFO/dalvikvm(213): threadid=7: reacting to signal 3
02-16 13:01:12.608: INFO/Process(51): Sending signal. PID: 154 SIG: 3
02-16 13:01:12.885: INFO/Process(51): Sending signal. PID: 146 SIG: 3
02-16 13:01:12.905: INFO/dalvikvm(213): Wrote stack trace to '/data/anr/traces.txt'
02-16 13:01:13.113: INFO/Process(51): Sending signal. PID: 189 SIG: 3
02-16 13:01:13.348: INFO/Process(51): Sending signal. PID: 181 SIG: 3
02-16 13:01:13.602: INFO/Process(51): Sending signal. PID: 170 SIG: 3
02-16 13:01:13.816: INFO/dalvikvm(146): threadid=7: reacting to signal 3
02-16 13:01:13.976: INFO/dalvikvm(189): threadid=7: reacting to signal 3
02-16 13:01:14.084: INFO/Process(51): Sending signal. PID: 103 SIG: 3
02-16 13:01:14.144: INFO/dalvikvm(103): threadid=7: reacting to signal 3
02-16 13:01:14.342: INFO/Process(51): Sending signal. PID: 106 SIG: 3
02-16 13:01:16.950: INFO/dalvikvm(170): threadid=7: reacting to signal 3
02-16 13:01:18.814: INFO/dalvikvm(181): threadid=7: reacting to signal 3
02-16 13:01:23.204: WARN/MediaPlayer(239): info/warning (1, 44)
02-16 13:01:23.578: DEBUG/AudioSink(30): bufferCount (4) is too small and increased to 12
02-16 13:01:24.137: WARN/AudioFlinger(30): write blocked for 76 msecs, 2 delayed writes, thread 0xb388
02-16 13:01:24.385: DEBUG/dalvikvm(239): GC freed 4564 objects / 281416 bytes in 77ms
02-16 13:01:24.914: INFO/MediaPlayer(239): Info (1,44)
02-16 13:01:25.537: INFO/dalvikvm(106): threadid=7: reacting to signal 3
02-16 13:01:26.370: INFO/dalvikvm(103): Wrote stack trace to '/data/anr/traces.txt'
02-16 13:01:26.435: INFO/dalvikvm(223): Wrote stack trace to '/data/anr/traces.txt'
02-16 13:01:27.350: INFO/dalvikvm(170): Wrote stack trace to '/data/anr/traces.txt'
02-16 13:01:27.611: INFO/dalvikvm(181): Wrote stack trace to '/data/anr/traces.txt'
02-16 13:01:28.074: INFO/ActivityManager(51): Starting activity: Intent { cmp=com.test.finalapp/.Leaderboard1 (has extras) }
02-16 13:01:28.934: INFO/ActivityManager(51): Displayed activity com.test.finalapp/.Leaderboard1: 754 ms (total 754 ms)
02-16 13:01:29.889: INFO/dalvikvm(189): Wrote stack trace to '/data/anr/traces.txt'
02-16 13:01:30.152: INFO/dalvikvm(146): Wrote stack trace to '/data/anr/traces.txt'
02-16 13:01:30.375: INFO/dalvikvm(154): Wrote stack trace to '/data/anr/traces.txt'
02-16 13:01:31.183: INFO/dalvikvm(106): Wrote stack trace to '/data/anr/traces.txt'
You should give us the code that is executed and, if you just call a method, give us the code of the method, too. Yous system.out will be printed in the logcat, just check for the tag System.
Even without your code, I can start a educated guess: Your button probably trigger a long taking operation and blocks the UI thread as the touchlistener runs on the UI Thread.
You should also consider moving it into an AsyncTask that is meant to be used for long term operations like internet access or calculations. You can update your UI easily from the AsyncTask, too.

Android ANR in process: com.android.inputmethod.latin Exception

I have got this type of memory exception some times on my apps, any body have idea about why this exception is occurred ?
E/ActivityThread( 390): Failed to find provider info for com.google.settings
E/ActivityThread( 390): Failed to find provider info for com.google.settings
I/ActivityThread( 390): Publishing provider com.android.globalsearch.SuggestionProvider: com.android.globalsearch.SuggestionProvider
W/ActivityManager( 51): Timeout executing service: ServiceRecord{439b4c30 com.android.inputmethod.latin/.LatinIME}
I/ActivityManager( 51): ANR in process: com.android.inputmethod.latin
I/ActivityManager( 51): Annotation: Executing service ComponentInfo{com.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME}
I/ActivityManager( 51): CPU usage:
I/ActivityManager( 51): Load: 2.07 / 0.89 / 0.35
I/ActivityManager( 51): CPU usage from 27357ms to 1782ms ago:
I/ActivityManager( 51): system_server: 10% = 3% user + 6% kernel / faults: 8566 minor 447 major
I/ActivityManager( 51): com.babbleville: 6% = 1% user + 4% kernel / faults: 3031 minor 188 major
I/ActivityManager( 51): com.android.inputmethod.latin: 5% = 0% user + 4% kernel / faults: 6296 minor 473 major
I/ActivityManager( 51): com.android.phone: 2% = 0% user + 2% kernel / faults: 3052 minor 101 major
I/ActivityManager( 51): adbd: 0% = 0% user + 0% kernel
I/ActivityManager( 51): logcat: 0% = 0% user + 0% kernel / faults: 291 minor 6 major
I/ActivityManager( 51): zygote: 0% = 0% user + 0% kernel / faults: 70 minor 3 major
I/ActivityManager( 51): pdflush: 0% = 0% user + 0% kernel
I/ActivityManager( 51): servicemanager: 0% = 0% user + 0% kernel / faults: 16 minor 4 major
I/ActivityManager( 51): logcat: 0% = 0% user + 0% kernel / faults: 290 minor 7 major
I/ActivityManager( 51): qemud: 0% = 0% user + 0% kernel / faults: 272 minor 3 major
I/ActivityManager( 51): +android.process.acore: 0% = 0% user + 0% kernel
I/ActivityManager( 51): TOTAL: 100% = 9% user + 30% kernel + 59% iowait + 0% irq + 0% softirq
I/ActivityManager( 51): Removing old ANR trace file from /data/anr/traces.txt
I/Process ( 51): Sending signal. PID: 384 SIG: 3
I/dalvikvm( 384): threadid=7: reacting to signal 3
I/Process ( 51): Sending signal. PID: 51 SIG: 3
I/dalvikvm( 51): threadid=7: reacting to signal 3
I/dalvikvm( 384): Wrote stack trace to '/data/anr/traces.txt'
I/ActivityThread( 390): Publishing provider com.android.globalsearch.stats: com.android.globalsearch.StatsProvider
I/ActivityThread( 390): Publishing provider contacts;call_log: com.android.providers.contacts.ContactsProvider
I/dalvikvm( 51): Wrote stack trace to '/data/anr/traces.txt'
I/Process ( 51): Sending signal. PID: 390 SIG: 3
I/dalvikvm( 390): threadid=7: reacting to signal 3
I/Process ( 51): Sending signal. PID: 358 SIG: 3
I/dalvikvm( 358): threadid=7: reacting to signal 3
I/dalvikvm( 390): Wrote stack trace to '/data/anr/traces.txt'
I/dalvikvm( 358): Wrote stack trace to '/data/anr/traces.txt'
I/Process ( 51): Sending signal. PID: 92 SIG: 3
I/dalvikvm( 92): threadid=7: reacting to signal 3
I/dalvikvm( 92): Wrote stack trace to '/data/anr/traces.txt'
==> ANR in process: com.android.inputmethod.latin
latin ime maybe blocked, find "message history" in your log or get /data/anr/traces.txt to know which process/thread is busy?
And from:
TOTAL: 100% = 9% user + 30% kernel + 59% iowait + 0% irq + 0% softirq
iowait is hight: maybe file read/write in busy status

Categories

Resources