ZXing integrated in Android App (incl. PhoneGap) - android

I want to use ZXing to decode a barcode in my Android App. I am using Phonegap to construct the app. Now I want to integrate ZXing to scan a barcode and handle the result in my app. I am using the Android 2.1 - update1 SDK.
First, I integrated the following classes in my app:
IntentIntegrator.java
IntentResult.java
Then I created an Activity called "Scanactivity" with the following content:
import android.app.Activity;
import android.content.Intent;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
public class ScanActivity extends Activity {
public void scanCode() {
IntentIntegrator.initiateScan(ScanActivity.this);
}
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null) {
// handle scan result
}
// else continue with any other code you need in the method
}
}
In the view I placed a button, which calls the scanCode() method by pressing.
$("#button_scan").click(function(e) {
ScanActivity.scanCode();
});
I installed the app "Barcode Scanner (ZXing)" on the target device to use the intent function. If I press the Scan-Button in my app, the app crashes and closes. What is my mistake?
Here is the logcat:
04-13 10:20:46.636: WARN/dalvikvm(2525): JNI WARNING: DeleteLocalRef(0x44caf3c0) failed to find entry (valid=1)
04-13 10:20:46.636: WARN/dalvikvm(2525): JNI WARNING: DeleteLocalRef(0x44caf3c0) failed to find entry (valid=1)
04-13 10:20:46.636: ERROR/dalvikvm(2525): Class lookup Landroid/webkit/WebHistoryItem; attemped while exception Ljava/lang/NullPointerException; pending
04-13 10:20:46.636: INFO/dalvikvm(2525): DALVIK THREADS:
04-13 10:20:46.636: INFO/dalvikvm(2525): "main" prio=5 tid=3 WAIT
04-13 10:20:46.636: INFO/dalvikvm(2525): | group="main" sCount=0 dsCount=0 s=N obj=0x4001e250 self=0xbe30
04-13 10:20:46.636: INFO/dalvikvm(2525): | sysTid=2525 nice=0 sched=0/0 cgrp=unknown handle=-1344001356
04-13 10:20:46.636: INFO/dalvikvm(2525): at java.lang.Object.wait(Native Method)
04-13 10:20:46.636: INFO/dalvikvm(2525): - waiting on <0x2488a8> (a android.os.MessageQueue)
04-13 10:20:46.636: INFO/dalvikvm(2525): at java.lang.Object.wait(Object.java:288)
04-13 10:20:46.636: INFO/dalvikvm(2525): at android.os.MessageQueue.next(MessageQueue.java:148)
04-13 10:20:46.636: INFO/dalvikvm(2525): at android.os.Looper.loop(Looper.java:110)
04-13 10:20:46.636: INFO/dalvikvm(2525): at android.app.ActivityThread.main(ActivityThread.java:4363)
04-13 10:20:46.636: INFO/dalvikvm(2525): at java.lang.reflect.Method.invokeNative(Native Method)
04-13 10:20:46.636: INFO/dalvikvm(2525): at java.lang.reflect.Method.invoke(Method.java:521)
04-13 10:20:46.636: INFO/dalvikvm(2525): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-13 10:20:46.636: INFO/dalvikvm(2525): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-13 10:20:46.636: INFO/dalvikvm(2525): at dalvik.system.NativeStart.main(Native Method)
04-13 10:20:46.646: INFO/dalvikvm(2525): "http3" prio=5 tid=31 WAIT
04-13 10:20:46.646: INFO/dalvikvm(2525): | group="main" sCount=0 dsCount=0 s=N obj=0x44c970a8 self=0x296f40
04-13 10:20:46.646: INFO/dalvikvm(2525): | sysTid=2544 nice=1 sched=0/0 cgrp=unknown handle=2715736
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.lang.Object.wait(Native Method)
04-13 10:20:46.646: INFO/dalvikvm(2525): - waiting on <0x28cff0> (a android.net.http.RequestQueue)
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.lang.Object.wait(Object.java:288)
04-13 10:20:46.646: INFO/dalvikvm(2525): at android.net.http.ConnectionThread.run(ConnectionThread.java:98)
04-13 10:20:46.646: INFO/dalvikvm(2525): "http2" prio=5 tid=29 WAIT
04-13 10:20:46.646: INFO/dalvikvm(2525): | group="main" sCount=0 dsCount=0 s=N obj=0x44c96e58 self=0x294f00
04-13 10:20:46.646: INFO/dalvikvm(2525): | sysTid=2543 nice=1 sched=0/0 cgrp=unknown handle=2707480
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.lang.Object.wait(Native Method)
04-13 10:20:46.646: INFO/dalvikvm(2525): - waiting on <0x28cff0> (a android.net.http.RequestQueue)
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.lang.Object.wait(Object.java:288)
04-13 10:20:46.646: INFO/dalvikvm(2525): at android.net.http.ConnectionThread.run(ConnectionThread.java:98)
04-13 10:20:46.646: INFO/dalvikvm(2525): "http1" prio=5 tid=27 WAIT
04-13 10:20:46.646: INFO/dalvikvm(2525): | group="main" sCount=0 dsCount=0 s=N obj=0x44c96ba0 self=0x294cf8
04-13 10:20:46.646: INFO/dalvikvm(2525): | sysTid=2542 nice=1 sched=0/0 cgrp=unknown handle=2706960
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.lang.Object.wait(Native Method)
04-13 10:20:46.646: INFO/dalvikvm(2525): - waiting on <0x28cff0> (a android.net.http.RequestQueue)
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.lang.Object.wait(Object.java:288)
04-13 10:20:46.646: INFO/dalvikvm(2525): at android.net.http.ConnectionThread.run(ConnectionThread.java:98)
04-13 10:20:46.646: INFO/dalvikvm(2525): "http0" prio=5 tid=25 WAIT
04-13 10:20:46.646: INFO/dalvikvm(2525): | group="main" sCount=0 dsCount=0 s=N obj=0x44c96990 self=0x294be0
04-13 10:20:46.646: INFO/dalvikvm(2525): | sysTid=2541 nice=1 sched=0/0 cgrp=unknown handle=2667208
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.lang.Object.wait(Native Method)
04-13 10:20:46.646: INFO/dalvikvm(2525): - waiting on <0x28cff0> (a android.net.http.RequestQueue)
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.lang.Object.wait(Object.java:288)
04-13 10:20:46.646: INFO/dalvikvm(2525): at android.net.http.ConnectionThread.run(ConnectionThread.java:98)
04-13 10:20:46.646: INFO/dalvikvm(2525): "Thread-12" prio=5 tid=23 TIMED_WAIT
04-13 10:20:46.646: INFO/dalvikvm(2525): | group="main" sCount=0 dsCount=0 s=N obj=0x44c7b460 self=0x261498
04-13 10:20:46.646: INFO/dalvikvm(2525): | sysTid=2540 nice=0 sched=0/0 cgrp=unknown handle=2375456
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.lang.Object.wait(Native Method)
04-13 10:20:46.646: INFO/dalvikvm(2525): - waiting on <0x2444b0> (a com.phonegap.DroidGap$1$1)
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.lang.Object.wait(Object.java:326)
04-13 10:20:46.646: INFO/dalvikvm(2525): at com.phonegap.DroidGap$1$1.run(DroidGap.java:387)
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.lang.Thread.run(Thread.java:1096)
04-13 10:20:46.646: INFO/dalvikvm(2525): "Thread-11" prio=5 tid=21 NATIVE
04-13 10:20:46.646: INFO/dalvikvm(2525): | group="main" sCount=0 dsCount=0 s=N obj=0x44c7af48 self=0x262998
04-13 10:20:46.646: INFO/dalvikvm(2525): | sysTid=2539 nice=0 sched=0/0 cgrp=unknown handle=2333912
04-13 10:20:46.646: INFO/dalvikvm(2525): at org.apache.harmony.luni.platform.OSNetworkSystem.acceptSocketImpl(Native Method)
04-13 10:20:46.646: INFO/dalvikvm(2525): at org.apache.harmony.luni.platform.OSNetworkSystem.accept(OSNetworkSystem.java:69)
04-13 10:20:46.646: INFO/dalvikvm(2525): at org.apache.harmony.luni.net.PlainSocketImpl.accept(PlainSocketImpl.java:126)
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.net.ServerSocket.implAccept(ServerSocket.java:285)
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.net.ServerSocket.accept(ServerSocket.java:164)
04-13 10:20:46.646: INFO/dalvikvm(2525): at com.phonegap.CallbackServer.run(CallbackServer.java:185)
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.lang.Thread.run(Thread.java:1096)
04-13 10:20:46.646: INFO/dalvikvm(2525): "CookieSyncManager" prio=5 tid=19 TIMED_WAIT
04-13 10:20:46.646: INFO/dalvikvm(2525): | group="main" sCount=0 dsCount=0 s=N obj=0x44c68588 self=0x127408
04-13 10:20:46.646: INFO/dalvikvm(2525): | sysTid=2538 nice=10 sched=0/0 cgrp=unknown handle=1220392
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.lang.Object.wait(Native Method)
04-13 10:20:46.646: INFO/dalvikvm(2525): - waiting on <0x23b538> (a android.os.MessageQueue)
04-13 10:20:46.646: INFO/dalvikvm(2525): at java.lang.Object.wait(Object.java:326)
04-13 10:20:46.646: INFO/dalvikvm(2525): at android.os.MessageQueue.next(MessageQueue.java:144)
04-13 10:20:46.646: INFO/dalvikvm(2525): at android.os.Looper.loop(Looper.java:110)
04-13 10:20:46.656: INFO/dalvikvm(2525): at android.webkit.WebSyncManager.run(WebSyncManager.java:90)
04-13 10:20:46.656: INFO/dalvikvm(2525): at java.lang.Thread.run(Thread.java:1096)
04-13 10:20:46.656: INFO/dalvikvm(2525): "WebViewCoreThread" prio=5 tid=17 RUNNABLE
04-13 10:20:46.656: INFO/dalvikvm(2525): | group="main" sCount=0 dsCount=0 s=N obj=0x44c63210 self=0x136478
04-13 10:20:46.656: INFO/dalvikvm(2525): | sysTid=2535 nice=0 sched=0/0 cgrp=unknown handle=1339552
04-13 10:20:46.656: INFO/dalvikvm(2525): at android.webkit.WebViewCore.nativeTouchUp(Native Method)
04-13 10:20:46.656: INFO/dalvikvm(2525): at android.webkit.WebViewCore.access$3400(WebViewCore.java:48)
04-13 10:20:46.656: INFO/dalvikvm(2525): at android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:1094)
04-13 10:20:46.656: INFO/dalvikvm(2525): at android.os.Handler.dispatchMessage(Handler.java:99)
04-13 10:20:46.656: INFO/dalvikvm(2525): at android.os.Looper.loop(Looper.java:123)
04-13 10:20:46.656: INFO/dalvikvm(2525): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:611)
04-13 10:20:46.656: INFO/dalvikvm(2525): at java.lang.Thread.run(Thread.java:1096)
04-13 10:20:46.656: INFO/dalvikvm(2525): "Binder Thread #3" prio=5 tid=15 NATIVE
04-13 10:20:46.656: INFO/dalvikvm(2525): | group="main" sCount=0 dsCount=0 s=N obj=0x44c530e8 self=0x130c70
04-13 10:20:46.656: INFO/dalvikvm(2525): | sysTid=2534 nice=0 sched=0/0 cgrp=unknown handle=1354864
04-13 10:20:46.656: INFO/dalvikvm(2525): at dalvik.system.NativeStart.run(Native Method)
04-13 10:20:46.656: INFO/dalvikvm(2525): "Binder Thread #2" prio=5 tid=13 NATIVE
04-13 10:20:46.656: INFO/dalvikvm(2525): | group="main" sCount=0 dsCount=0 s=N obj=0x44c53028 self=0x1269e0
04-13 10:20:46.656: INFO/dalvikvm(2525): | sysTid=2533 nice=0 sched=0/0 cgrp=unknown handle=1383744
04-13 10:20:46.656: INFO/dalvikvm(2525): at dalvik.system.NativeStart.run(Native Method)
04-13 10:20:46.656: INFO/dalvikvm(2525): "Binder Thread #1" prio=5 tid=11 NATIVE
04-13 10:20:46.656: INFO/dalvikvm(2525): | group="main" sCount=0 dsCount=0 s=N obj=0x44c4dc50 self=0x132840
04-13 10:20:46.656: INFO/dalvikvm(2525): | sysTid=2532 nice=0 sched=0/0 cgrp=unknown handle=1354576
04-13 10:20:46.656: INFO/dalvikvm(2525): at dalvik.system.NativeStart.run(Native Method)
04-13 10:20:46.656: INFO/dalvikvm(2525): "JDWP" daemon prio=5 tid=9 VMWAIT
04-13 10:20:46.656: INFO/dalvikvm(2525): | group="system" sCount=0 dsCount=0 s=N obj=0x44c4c2a0 self=0x14e0f0
04-13 10:20:46.656: INFO/dalvikvm(2525): | sysTid=2529 nice=0 sched=0/0 cgrp=unknown handle=1135864
04-13 10:20:46.656: INFO/dalvikvm(2525): at dalvik.system.NativeStart.run(Native Method)
04-13 10:20:46.656: INFO/dalvikvm(2525): "Signal Catcher" daemon prio=5 tid=7 VMWAIT
04-13 10:20:46.656: INFO/dalvikvm(2525): | group="system" sCount=0 dsCount=0 s=N obj=0x44c4c1e8 self=0x1127b0
04-13 10:20:46.656: INFO/dalvikvm(2525): | sysTid=2528 nice=0 sched=0/0 cgrp=unknown handle=1338232
04-13 10:20:46.656: INFO/dalvikvm(2525): at dalvik.system.NativeStart.run(Native Method)
04-13 10:20:46.656: INFO/dalvikvm(2525): "HeapWorker" daemon prio=5 tid=5 VMWAIT
04-13 10:20:46.656: INFO/dalvikvm(2525): | group="system" sCount=0 dsCount=0 s=N obj=0x43562ed8 self=0x12b268
04-13 10:20:46.656: INFO/dalvikvm(2525): | sysTid=2526 nice=0 sched=0/0 cgrp=unknown handle=1355192
04-13 10:20:46.656: INFO/dalvikvm(2525): at dalvik.system.NativeStart.run(Native Method)
04-13 10:20:46.656: ERROR/dalvikvm(2525): VM aborting
This is the stack:
ScanActivity.scanCode() line: 12
IntentIntegrator.initiateScan(ScanActivity.this);
Activity.class:
ScanActivity(Activity).startActivityForResult(Intent, int) line: 2749
Reference.class:
WeakReference(Reference).get() line: 147
Then the app terminates.

Check out the PhoneGap barcode tutorial here. It will take you step by step to creating a sample app with zxing via the PhoneGap plugin from purplecabbage.

Related

Android PackageManger -- Exception

When getting the list of packages which is running in devices, i am getting the execption proxy stub exception from my logcat
This the code i used
List packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
This the exception which im am getting
(mutexes: tll=0 tsl=0 tscl=0 ghl=0)
"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x40ab1478 self=0x112f910
| sysTid=1801 nice=0 sched=0/0 cgrp=default handle=1074439528
| schedstat=( 0 0 0 ) utm=465 stm=85 core=1
at android.os.BinderProxy.transact(Native Method)
at android.content.pm.IPackageManager$Stub$Proxy.getInstalledApplications(IPackageManager.java:1930)
at android.app.ApplicationPackageManager.getInstalledApplications(ApplicationPackageManager.java:414)
at com.informate.smnpd.DataUsageAppManager.processData1(DataUsageAppManager.java:237)
at com.informate.smnpd.DataUsageAppManager.processData(DataUsageAppManager.java:114)
at com.informate.smnpd.BackgroundService.getData(BackgroundService.java:667)
at com.informate.smnpd.ManualUpdate.onClick(ManualUpdate.java:221)
at android.view.View.performClick(View.java:3526)
at android.view.View$PerformClick.run(View.java:14133)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4697)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
at dalvik.system.NativeStart.main(Native Method)
Can anyone please guide me on why this exception will occures at the time of getting installed package name. Thanks in advance

Android: Activity Window Died (WINDOW DIED) on 4.0.4 ICS Devices [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I am getting IllegalArgumentException in an 4.0 ICS Devices on one of my Activity..
I/WindowManager( 529): WINDOW DIED Window{419a4a18 XXX.XXXXXX.XXX.XXX/XXX.XXXXXX.XXX.XXX.XXXXXXXXXXXXXXXXXXXXX paused=false}
E/SurfaceTexture( 225): [com.sample/com.sample.MyActivity] dequeueBuffer: SurfaceTexture has been abandoned!
E/SurfaceTextureClient( 9044): dequeueBuffer failed (No such device)
E/ViewRootImpl( 9044): IllegalArgumentException locking surface
E/ViewRootImpl( 9044): java.lang.IllegalArgumentException
E/ViewRootImpl( 9044): at android.view.Surface.lockCanvasNative(Native Method)
E/ViewRootImpl( 9044): at android.view.Surface.lockCanvas(Surface.java:76)
E/ViewRootImpl( 9044): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2157)
E/ViewRootImpl( 9044): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1846)
E/ViewRootImpl( 9044): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2658)
E/ViewRootImpl( 9044): at android.os.Handler.dispatchMessage(Handler.java:99)
E/ViewRootImpl( 9044): at android.os.Looper.loop(Looper.java:137)
E/ViewRootImpl( 9044): at android.app.ActivityThread.main(ActivityThread.java:4514)
E/ViewRootImpl( 9044): at java.lang.reflect.Method.invokeNative(Native Method)
E/ViewRootImpl( 9044): at java.lang.reflect.Method.invoke(Method.java:511)
E/ViewRootImpl( 9044): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
E/ViewRootImpl( 9044): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
E/ViewRootImpl( 9044): at dalvik.system.NativeStart.main(Native Method)
New Logs : 16 -08 -2012
Device Used : Samsung Galaxy S3
Android Version : 4.0.4
Issue not seen in 2.3 and below..
I have a TabActivity, within which i have childactivites(List Activities)..From one of my child activity i go to one more activity and do some work and come back to same Child activity(Update the View in ListActivity).If I Repeatedly do the above i get the Below Exception and screen goes Blank.
08-16 15:43:00.271: I/ClipboardServiceEx(533): Send intent for dismiss clipboard dialog inside hideCurrentInputLocked() !
08-16 15:43:00.291: D/memalloc(224): ion: Allocated buffer base:0x45808000 size:3768320 fd:56
08-16 15:43:00.291: D/memalloc(27338): ion: Mapped buffer base:0x60a28000 size:3768320 offset:0 fd:93
08-16 15:43:00.291: I/Adreno200-EGLSUB(224): <CreateImage:893>: Android Image
08-16 15:43:00.291: I/Adreno200-EGLSUB(224): <GetImageAttributes:1102>: RGBA_8888
08-16 15:43:00.291: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.291: I/ActivityManager(533): Displayed shortComponentName: +329ms
08-16 15:43:00.291: D/DEFERED_APP_VISIBILITY(533): tweaking closing app
08-16 15:43:00.301: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.301: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.301: D/memalloc(27338): ion: Unmapping buffer base:0x602f8000 size:3768320
08-16 15:43:00.301: D/memalloc(27338): ion: Unmapping buffer base:0x5ff38000 size:3768320
08-16 15:43:00.301: W/InputDispatcher(533): channel ~ Consumer closed input channel or an error occurred. events=0x8
08-16 15:43:00.301: E/InputDispatcher(533): channel ~ Channel is unrecoverably broken and will be disposed!
08-16 15:43:00.301: W/InputDispatcher(533): Attempted to unregister already unregistered input channel
08-16 15:43:00.301: I/WindowManager(533): WINDOW DIED Window{427c45a0 XXX.XXXXXX.XX/XXX.XXXXXX.XX.XXXXXXXXXXXXXXXXXXXXX paused=false}
08-16 15:43:00.311: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.311: D/memalloc(224): ion: Freeing buffer base:0x43117000 size:3768320 fd:62
08-16 15:43:00.311: D/memalloc(224): ion: Unmapping buffer base:0x43117000 size:3768320
08-16 15:43:00.311: D/memalloc(224): ion: Freeing buffer base:0x434af000 size:3768320 fd:43
08-16 15:43:00.311: D/memalloc(224): ion: Unmapping buffer base:0x434af000 size:3768320
08-16 15:43:00.311: D/memalloc(27338): ion: Unmapping buffer base:0x5f66f000 size:3768320
08-16 15:43:00.311: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.311: E/InputQueue-JNI(27338): channel '427c45a0 com.org.ui/com.org.ui.CreateContactActivity (client)' ~ Publisher closed input channel or an error occurred. events=0x8
08-16 15:43:00.321: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.321: D/memalloc(224): ion: Allocated buffer base:0x43117000 size:3768320 fd:40
08-16 15:43:00.331: D/memalloc(27338): ion: Mapped buffer base:0x5f66f000 size:3768320 offset:0 fd:61
08-16 15:43:00.341: I/Adreno200-EGLSUB(224): <CreateImage:893>: Android Image
08-16 15:43:00.341: I/Adreno200-EGLSUB(224): <GetImageAttributes:1102>: RGBA_8888
08-16 15:43:00.341: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.361: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.371: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.391: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.401: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.421: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.441: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.451: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.471: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.491: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.501: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.521: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.521: W/SurfaceFlinger(224): id=1810 Removed idx=5 Map Size=5
08-16 15:43:00.521: W/SurfaceFlinger(224): id=1809 Removed idx=3 Map Size=4
08-16 15:43:00.521: W/SurfaceFlinger(224): id=1809 Removed idx=-2 Map Size=4
08-16 15:43:00.521: W/SurfaceFlinger(224): id=1807 Removed idx=1 Map Size=3
08-16 15:43:00.521: W/SurfaceFlinger(224): id=1807 Removed idx=-2 Map Size=3
08-16 15:43:00.521: D/KeyguardViewMediator(533): setHidden false
08-16 15:43:00.551: D/memalloc(224): ion: Freeing buffer base:0x453ad000 size:3768320 fd:32
08-16 15:43:00.551: D/memalloc(224): ion: Unmapping buffer base:0x453ad000 size:3768320
08-16 15:43:00.551: D/memalloc(224): ion: Freeing buffer base:0x43117000 size:3768320 fd:40
08-16 15:43:00.551: D/memalloc(224): ion: Unmapping buffer base:0x43117000 size:3768320
08-16 15:43:00.571: D/memalloc(224): ion: Freeing buffer base:0x4414e000 size:1146880 fd:68
08-16 15:43:00.571: D/memalloc(224): ion: Unmapping buffer base:0x4414e000 size:1146880
08-16 15:43:00.571: D/memalloc(224): ion: Freeing buffer base:0x42a2c000 size:3768320 fd:34
08-16 15:43:00.571: D/memalloc(224): ion: Unmapping buffer base:0x42a2c000 size:3768320
08-16 15:43:00.691: E/MP-Decision(1408): DOWN Ld:34 Ns:1.100000 Ts:190 rq:0.000000 seq:196.000000
08-16 15:43:00.701: W/SignalStrength(533): getGsmLevel=5
08-16 15:43:00.701: W/SignalStrength(533): getLevel=5 (SignalStrength: 18 0 -120 -160 -120 -1 -1 99 2147483647 2147483647 2147483647 2147483647 gsm|lte 5)
08-16 15:43:00.701: W/SignalStrength(658): getGsmLevel=5
08-16 15:43:00.701: W/SignalStrength(658): getLevel=5 (SignalStrength: 18 0 -120 -160 -120 -1 -1 99 2147483647 2147483647 2147483647 2147483647 gsm|lte 5)
08-16 15:43:00.701: W/SignalStrength(658): getGsmLevel=5
08-16 15:43:00.701: W/SignalStrength(658): getLevel=5 (SignalStrength: 18 0 -120 -160 -120 -1 -1 99 2147483647 2147483647 2147483647 2147483647 gsm|lte 5)
08-16 15:43:00.701: W/SignalStrength(533): getDbm 1
08-16 15:43:00.701: W/SignalStrength(533): getGsmDbm=-77
08-16 15:43:00.701: W/SignalStrength(533): getDbm=-77
08-16 15:43:00.701: W/SignalStrength(533): getAsuLevel 1
08-16 15:43:00.701: W/SignalStrength(533): getGsmAsuLevel=18
08-16 15:43:00.701: W/SignalStrength(533): getAsuLevel=18
08-16 15:43:00.701: D/STATUSBAR-NetworkController(658): onSignalStrengthsChanged signalStrength=SignalStrength: 18 0 -120 -160 -120 -1 -1 99 2147483647 2147483647 2147483647 2147483647 gsm|lte 5 level=5
08-16 15:43:00.932: I/power(533): *** release_dvfs_lock : lockType : 1
08-16 15:43:00.932: D/PowerManagerService(533): releaseDVFSLockLocked : all DVFS_MIN_LIMIT are released
08-16 15:43:00.932: W/ActivityManager(533): mDVFSLock.release()
08-16 15:43:01.312: E/SurfaceTexture(224): [com.org.ui/com.org.ui.CreateContactActivity] dequeueBuffer: SurfaceTexture has been abandoned!
08-16 15:43:01.312: W/Adreno200-EGLSUB(27338): <SwapBuffers:763>: dequeue native buffer fail: No such device
08-16 15:43:01.312: E/SurfaceTexture(224): [com.org.ui/com.org.ui.CreateContactActivity] dequeueBuffer: SurfaceTexture has been abandoned!
08-16 15:43:01.312: W/Adreno200-EGLSUB(27338): <GetSurfaceSize:276>: dequeue native buffer failed: No such device.
08-16 15:43:01.312: E/SurfaceTexture(224): [com.org.ui/com.org.ui.CreateContactActivity] dequeueBuffer: SurfaceTexture has been abandoned!
08-16 15:43:01.312: W/Adreno200-EGLSUB(27338): <GetSurfaceSize:276>: dequeue native buffer failed: No such device.
08-16 15:43:01.312: E/Adreno200-EGL(27338): <eglSurfaceResize:4030>: EGL_BAD_ALLOC
08-16 15:43:01.312: W/HardwareRenderer(27338): EGL error: EGL_BAD_ALLOC
08-16 15:43:01.312: E/SurfaceTexture(224): [com.org.ui/com.org.ui.CreateContactActivity] queueBuffer: SurfaceTexture has been abandoned!
08-16 15:43:01.312: E/SurfaceTextureClient(27338): queueBuffer: error queuing buffer to SurfaceTexture, -19
08-16 15:43:01.312: D/memalloc(27338): ion: Unmapping buffer base:0x60690000 size:3768320
08-16 15:43:01.312: D/memalloc(27338): ion: Unmapping buffer base:0x60a28000 size:3768320
08-16 15:43:01.312: D/memalloc(27338): ion: Unmapping buffer base:0x5f66f000 size:3768320
08-16 15:43:01.312: W/HardwareRenderer(27338): Mountain View, we've had a problem here. Switching back to software rendering.
08-16 15:43:01.312: E/SurfaceTexture(224): [com.org.ui/com.org.ui.CreateContactActivity] connect: SurfaceTexture has been abandoned!
08-16 15:43:01.322: E/ViewRootImpl(27338): IllegalArgumentException locking surface
08-16 15:43:01.322: E/ViewRootImpl(27338): java.lang.IllegalArgumentException
08-16 15:43:01.322: E/ViewRootImpl(27338): at android.view.Surface.lockCanvasNative(Native Method)
08-16 15:43:01.322: E/ViewRootImpl(27338): at android.view.Surface.lockCanvas(Surface.java:76)
08-16 15:43:01.322: E/ViewRootImpl(27338): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2157)
08-16 15:43:01.322: E/ViewRootImpl(27338): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1846)
08-16 15:43:01.322: E/ViewRootImpl(27338): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2658)
08-16 15:43:01.322: E/ViewRootImpl(27338): at android.os.Handler.dispatchMessage(Handler.java:99)
08-16 15:43:01.322: E/ViewRootImpl(27338): at android.os.Looper.loop(Looper.java:137)
08-16 15:43:01.322: E/ViewRootImpl(27338): at android.app.ActivityThread.main(ActivityThread.java:4514)
08-16 15:43:01.322: E/ViewRootImpl(27338): at java.lang.reflect.Method.invokeNative(Native Method)
08-16 15:43:01.322: E/ViewRootImpl(27338): at java.lang.reflect.Method.invoke(Method.java:511)
08-16 15:43:01.322: E/ViewRootImpl(27338): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
08-16 15:43:01.322: E/ViewRootImpl(27338): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
08-16 15:43:01.322: E/ViewRootImpl(27338): at dalvik.system.NativeStart.main(Native Method)
My Activity is been killed by system "WINDOW DIED".???What is the reason behind IllegalArgumentException ..
17 - 08- 2012
Adding ANR Traces
----- pid 23522 at 2012-08-17 15:11:59 -----
Cmd line: com.org.ui
DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0)
"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x40c3ccd0 self=0x18d7c30
| sysTid=23522 nice=0 sched=0/0 cgrp=default handle=1074070920
| schedstat=( 0 0 0 ) utm=5508 stm=1030 core=0
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:118)
at android.os.Looper.loop(Looper.java:118)
at android.app.ActivityThread.main(ActivityThread.java:4514)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
at dalvik.system.NativeStart.main(Native Method)
"pool-1-thread-1" prio=5 tid=18 WAIT
| group="main" sCount=1 dsCount=0 obj=0x428acb78 self=0x1f78210
| sysTid=27231 nice=0 sched=0/0 cgrp=default handle=32950048
| schedstat=( 0 0 0 ) utm=0 stm=0 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x428accc0> (a java.lang.VMThread) held by tid=18 (pool-1-thread-1)
at java.lang.Thread.parkFor(Thread.java:1231)
at sun.misc.Unsafe.park(Unsafe.java:323)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
"Binder Thread #3" prio=5 tid=17 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x422a2f08 self=0x1df2260
| sysTid=25366 nice=0 sched=0/0 cgrp=default handle=31652384
| schedstat=( 0 0 0 ) utm=1 stm=3 core=0
at dalvik.system.NativeStart.run(Native Method)
"AsyncTask #5" prio=5 tid=16 WAIT
| group="main" sCount=1 dsCount=0 obj=0x4229a048 self=0x1d22328
| sysTid=23628 nice=10 sched=0/0 cgrp=bg_non_interactive handle=30355128
| schedstat=( 0 0 0 ) utm=50 stm=18 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x4229a1a0> (a java.lang.VMThread) held by tid=16 (AsyncTask #5)
at java.lang.Thread.parkFor(Thread.java:1231)
at sun.misc.Unsafe.park(Unsafe.java:323)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
"AsyncTask #4" prio=5 tid=12 WAIT
| group="main" sCount=1 dsCount=0 obj=0x4239ff38 self=0x1cf18e8
| sysTid=23620 nice=10 sched=0/0 cgrp=bg_non_interactive handle=30297720
| schedstat=( 0 0 0 ) utm=13 stm=6 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x423a0058> (a java.lang.VMThread) held by tid=12 (AsyncTask #4)
at java.lang.Thread.parkFor(Thread.java:1231)
at sun.misc.Unsafe.park(Unsafe.java:323)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
"AsyncTask #3" prio=5 tid=15 WAIT
| group="main" sCount=1 dsCount=0 obj=0x42383350 self=0x1ce8e60
| sysTid=23619 nice=10 sched=0/0 cgrp=bg_non_interactive handle=30362952
| schedstat=( 0 0 0 ) utm=12 stm=5 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x42383470> (a java.lang.VMThread) held by tid=15 (AsyncTask #3)
at java.lang.Thread.parkFor(Thread.java:1231)
at sun.misc.Unsafe.park(Unsafe.java:323)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
"AsyncTask #2" prio=5 tid=14 WAIT
| group="main" sCount=1 dsCount=0 obj=0x419fc028 self=0x1c75928
| sysTid=23606 nice=10 sched=0/0 cgrp=bg_non_interactive handle=27987104
| schedstat=( 0 0 0 ) utm=13 stm=6 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x419fc148> (a java.lang.VMThread) held by tid=14 (AsyncTask #2)
at java.lang.Thread.parkFor(Thread.java:1231)
at sun.misc.Unsafe.park(Unsafe.java:323)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
"AsyncTask #1" prio=5 tid=13 WAIT
| group="main" sCount=1 dsCount=0 obj=0x42333a08 self=0x1c8c400
| sysTid=23562 nice=10 sched=0/0 cgrp=bg_non_interactive handle=29698528
| schedstat=( 0 0 0 ) utm=10 stm=5 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x42333c80> (a java.lang.VMThread) held by tid=13 (AsyncTask #1)
at java.lang.Thread.parkFor(Thread.java:1231)
at sun.misc.Unsafe.park(Unsafe.java:323)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
"Timer-0" prio=5 tid=11 TIMED_WAIT
| group="main" sCount=1 dsCount=0 obj=0x419df490 self=0x1abe1f0
| sysTid=23538 nice=0 sched=0/0 cgrp=default handle=27981992
| schedstat=( 0 0 0 ) utm=0 stm=0 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x419df490> (a java.util.Timer$TimerImpl)
at java.lang.Object.wait(Object.java:401)
at java.util.Timer$TimerImpl.run(Timer.java:238)
"Binder Thread #2" prio=5 tid=10 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x419b52c8 self=0x1a9bf00
| sysTid=23534 nice=0 sched=0/0 cgrp=default handle=28053104
| schedstat=( 0 0 0 ) utm=6 stm=3 core=0
at dalvik.system.NativeStart.run(Native Method)
"Binder Thread #1" prio=5 tid=9 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x419b51c8 self=0x1aaff90
| sysTid=23533 nice=0 sched=0/0 cgrp=default handle=27190280
| schedstat=( 0 0 0 ) utm=4 stm=5 core=0
at dalvik.system.NativeStart.run(Native Method)
"FinalizerWatchdogDaemon" daemon prio=5 tid=8 WAIT
| group="main" sCount=1 dsCount=0 obj=0x419b17a8 self=0x1a7ee40
| sysTid=23531 nice=0 sched=0/0 cgrp=default handle=27983144
| schedstat=( 0 0 0 ) utm=0 stm=0 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x40c444f8> (a java.lang.Daemons$FinalizerWatchdogDaemon)
at java.lang.Object.wait(Object.java:364)
at java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:213)
at java.lang.Thread.run(Thread.java:856)
"FinalizerDaemon" daemon prio=5 tid=7 WAIT
| group="main" sCount=1 dsCount=0 obj=0x419b1650 self=0x1abba90
| sysTid=23530 nice=0 sched=0/0 cgrp=default handle=27190632
| schedstat=( 0 0 0 ) utm=22 stm=5 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x40c325d0> (a java.lang.ref.ReferenceQueue)
at java.lang.Object.wait(Object.java:401)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:168)
at java.lang.Thread.run(Thread.java:856)
"ReferenceQueueDaemon" daemon prio=5 tid=6 WAIT
| group="main" sCount=1 dsCount=0 obj=0x419b14e8 self=0x1aa9f10
| sysTid=23529 nice=0 sched=0/0 cgrp=default handle=27190568
| schedstat=( 0 0 0 ) utm=5 stm=0 core=1
at java.lang.Object.wait(Native Method)
- waiting on <0x40c324f8>
at java.lang.Object.wait(Object.java:364)
at java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:128)
at java.lang.Thread.run(Thread.java:856)
"Compiler" daemon prio=5 tid=5 VMWAIT
| group="system" sCount=1 dsCount=0 obj=0x419b13f8 self=0x1aadcc8
| sysTid=23528 nice=0 sched=0/0 cgrp=default handle=27983024
| schedstat=( 0 0 0 ) utm=73 stm=49 core=0
at dalvik.system.NativeStart.run(Native Method)
"JDWP" daemon prio=5 tid=4 VMWAIT
| group="system" sCount=1 dsCount=0 obj=0x419b12b0 self=0x1a9dda0
| sysTid=23527 nice=0 sched=0/0 cgrp=default handle=27766168
| schedstat=( 0 0 0 ) utm=0 stm=0 core=1
at dalvik.system.NativeStart.run(Native Method)
"Signal Catcher" daemon prio=5 tid=3 RUNNABLE
| group="system" sCount=0 dsCount=0 obj=0x419b11b8 self=0x19c7f78
| sysTid=23526 nice=0 sched=0/0 cgrp=default handle=27706080
| schedstat=( 0 0 0 ) utm=0 stm=0 core=0
at dalvik.system.NativeStart.run(Native Method)
"GC" daemon prio=5 tid=2 VMWAIT
| group="system" sCount=1 dsCount=0 obj=0x419b10d8 self=0x1982b48
| sysTid=23524 nice=0 sched=0/0 cgrp=default handle=27705984
| schedstat=( 0 0 0 ) utm=59 stm=6 core=0
at dalvik.system.NativeStart.run(Native Method)
----- end 23522 -----
What might be the reason for ActivityThread to get Blocked??
Thanks
NitZ
The issue was with the Native Code(File Pointer Issue) in my project!!! But system is not able to throw the same error to ADB but instead it was throwing the above error!! pretty Strange though!!

App dies on startup

When I start my app, I start an AsyncTask to do some downloading. This can take a while.
When that thread is downloading the data, I am already listening for location updates. When I receive a new location, I start a new AsyncTask to do some processing. However, this class depends on the downloaded data, so it has to wait until the downloading is done:
public void setLocation(Location location) throws IOException {
Logger.log("New location - calculating nearest stations");
if (!initialStationsRead) {
Logger.log("Location update waiting for stations to be read");
while (!initialStationsRead)
;
Logger.log("Location update done waiting");
}
/* Do the processing */
}
The first thread sets initialStationsRead to true when it's done, so the second thread can pick up after that. This all works fine on my test devices.
However, I received an email from a user telling me that the app won't start. The loading screen appeared, and after 10-12 seconds disappeared without a warning. He uses a HTC One S.
This is the logcat he sent me:
07-05 22:11:04.938: W/dalvikvm(19961): threadid=2: spin on suspend #2 threadid=11 (pcf=1)
07-05 22:11:04.938: I/dalvikvm(19961): "GC" daemon prio=5 tid=2 RUNNABLE
07-05 22:11:04.938: I/dalvikvm(19961): | group="system" sCount=0 dsCount=0 obj=0x40d5c580 self=0x1669ae8
07-05 22:11:04.938: I/dalvikvm(19961): | sysTid=19965 nice=0 sched=0/0 cgrp=default handle=21931384
07-05 22:11:04.938: I/dalvikvm(19961): | schedstat=( 0 0 0 ) utm=2 stm=0 core=1
07-05 22:11:04.938: I/dalvikvm(19961): at dalvik.system.NativeStart.run(Native Method)
07-05 22:11:04.938: I/dalvikvm(19961): "AsyncTask #3" prio=5 tid=11 RUNNABLE JIT
07-05 22:11:04.938: I/dalvikvm(19961): | group="main" sCount=1 dsCount=0 obj=0x40f90588 self=0x1b35b00
07-05 22:11:04.938: I/dalvikvm(19961): | sysTid=19991 nice=0 sched=0/0 cgrp=default handle=29193008
07-05 22:11:04.938: I/dalvikvm(19961): | schedstat=( 0 0 0 ) utm=287 stm=1 core=1
07-05 22:11:04.938: I/dalvikvm(19961): at com.busybits.treinverkeer.data.Data.setLocation(Data.java:~102)
07-05 22:11:04.938: I/dalvikvm(19961): at com.busybits.treinverkeer.TreinVerkeer$SetLocationAsyncTask.doInBackground(TreinVerkeer.java:408)
07-05 22:11:04.938: I/dalvikvm(19961): at com.busybits.treinverkeer.TreinVerkeer$SetLocationAsyncTask.doInBackground(TreinVerkeer.java:1)
07-05 22:11:04.938: I/dalvikvm(19961): at android.os.AsyncTask$2.call(AsyncTask.java:264)
07-05 22:11:04.938: I/dalvikvm(19961): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
07-05 22:11:04.938: I/dalvikvm(19961): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
07-05 22:11:04.938: I/dalvikvm(19961): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
07-05 22:11:04.938: I/dalvikvm(19961): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
07-05 22:11:04.938: I/dalvikvm(19961): at java.lang.Thread.run(Thread.java:864)
07-05 22:11:05.629: D/WifiStateMachine(436): fetchRssiAndLinkSpeedNative RSSI = -32
07-05 22:11:05.689: W/dalvikvm(19961): threadid=2: spin on suspend #3 threadid=11 (pcf=1)
07-05 22:11:05.689: I/dalvikvm(19961): "GC" daemon prio=5 tid=2 RUNNABLE
07-05 22:11:05.689: I/dalvikvm(19961): | group="system" sCount=0 dsCount=0 obj=0x40d5c580 self=0x1669ae8
07-05 22:11:05.689: I/dalvikvm(19961): | sysTid=19965 nice=0 sched=0/0 cgrp=default handle=21931384
07-05 22:11:05.689: I/dalvikvm(19961): | schedstat=( 0 0 0 ) utm=2 stm=0 core=1
07-05 22:11:05.689: I/dalvikvm(19961): at dalvik.system.NativeStart.run(Native Method)
07-05 22:11:05.689: I/dalvikvm(19961): "AsyncTask #3" prio=5 tid=11 RUNNABLE JIT
07-05 22:11:05.689: I/dalvikvm(19961): | group="main" sCount=1 dsCount=0 obj=0x40f90588 self=0x1b35b00
07-05 22:11:05.689: I/dalvikvm(19961): | sysTid=19991 nice=0 sched=0/0 cgrp=default handle=29193008
07-05 22:11:05.689: I/dalvikvm(19961): | schedstat=( 0 0 0 ) utm=362 stm=1 core=1
07-05 22:11:05.689: I/dalvikvm(19961): at com.busybits.treinverkeer.data.Data.setLocation(Data.java:~102)
07-05 22:11:05.689: I/dalvikvm(19961): at com.busybits.treinverkeer.TreinVerkeer$SetLocationAsyncTask.doInBackground(TreinVerkeer.java:408)
07-05 22:11:05.689: I/dalvikvm(19961): at com.busybits.treinverkeer.TreinVerkeer$SetLocationAsyncTask.doInBackground(TreinVerkeer.java:1)
07-05 22:11:05.689: I/dalvikvm(19961): at android.os.AsyncTask$2.call(AsyncTask.java:264)
07-05 22:11:05.689: I/dalvikvm(19961): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
07-05 22:11:05.689: I/dalvikvm(19961): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
07-05 22:11:05.689: I/dalvikvm(19961): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
07-05 22:11:05.689: I/dalvikvm(19961): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
07-05 22:11:05.689: I/dalvikvm(19961): at java.lang.Thread.run(Thread.java:864)
07-05 22:11:05.719: D/skia(1004): AndroidImageRef[ 0x2438190 ] releasePixel fail as lockCount=1
07-05 22:11:06.439: W/dalvikvm(19961): threadid=2: spin on suspend #4 threadid=11 (pcf=1)
07-05 22:11:06.439: I/dalvikvm(19961): "GC" daemon prio=5 tid=2 RUNNABLE
07-05 22:11:06.439: I/dalvikvm(19961): | group="system" sCount=0 dsCount=0 obj=0x40d5c580 self=0x1669ae8
07-05 22:11:06.439: I/dalvikvm(19961): | sysTid=19965 nice=0 sched=0/0 cgrp=default handle=21931384
07-05 22:11:06.439: I/dalvikvm(19961): | schedstat=( 0 0 0 ) utm=2 stm=0 core=1
07-05 22:11:06.439: I/dalvikvm(19961): at dalvik.system.NativeStart.run(Native Method)
07-05 22:11:06.439: I/dalvikvm(19961): "AsyncTask #3" prio=5 tid=11 RUNNABLE JIT
07-05 22:11:06.439: I/dalvikvm(19961): | group="main" sCount=1 dsCount=0 obj=0x40f90588 self=0x1b35b00
07-05 22:11:06.439: I/dalvikvm(19961): | sysTid=19991 nice=0 sched=0/0 cgrp=default handle=29193008
07-05 22:11:06.439: I/dalvikvm(19961): | schedstat=( 0 0 0 ) utm=437 stm=1 core=1
07-05 22:11:06.439: I/dalvikvm(19961): at com.busybits.treinverkeer.data.Data.setLocation(Data.java:~102)
07-05 22:11:06.439: I/dalvikvm(19961): at com.busybits.treinverkeer.TreinVerkeer$SetLocationAsyncTask.doInBackground(TreinVerkeer.java:408)
07-05 22:11:06.439: I/dalvikvm(19961): at com.busybits.treinverkeer.TreinVerkeer$SetLocationAsyncTask.doInBackground(TreinVerkeer.java:1)
07-05 22:11:06.439: I/dalvikvm(19961): at android.os.AsyncTask$2.call(AsyncTask.java:264)
07-05 22:11:06.439: I/dalvikvm(19961): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
07-05 22:11:06.439: I/dalvikvm(19961): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
07-05 22:11:06.439: I/dalvikvm(19961): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
07-05 22:11:06.439: I/dalvikvm(19961): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
07-05 22:11:06.439: I/dalvikvm(19961): at java.lang.Thread.run(Thread.java:864)
This is repeated x times.
Now, Data.java:102 is the line while(!initialStationsRead), so there must be going something wrong there.
What is happening, and how can I solve this?
The first thread sets initialStationsRead to true when it's done, so the second thread can pick up after that.
Busy loops are evil incarnate. If I had holy water handy, you'd be rather wet right now. :-)
(that also implies that I have really good holy-water throwing aim over long distances, which probably isn't the case)
Java has plenty of options for thread synchronization, and has had them for a decade-plus, from the low-level wait() and notify() on Object to the java.util.concurrent constructs like Semaphore. Pick one and use it, getting rid of the busy loop.
Or, follow Jan-Henk's advice and do the work serially on the same thread, based on a flag.
Any idea though why this happens on his device and not on mine or devices of other people i know?
Well, for starters, the One S is dual-core, and so your threads may actually be running at the same time (one per core). Threading problems will be more likely to surface in multi-core environments.
Also, Angelo's answer -- posted while I was writing this -- is worth noting.
I don't know if that helps but keep in mind that after HoneyComb (Android 3.0) and before Donut (Android 1.6) only one AsyncTask can run simultaneously, since AsyncTask use a thread pool pattern and the default thread pool size on these versions is 1. If you want the AsyncTasks you are using to run simulteneously in these versions of Android, you can use this code executeOnExecutor(Executor, Params...) using the flag THREAD_POOL_EXECUTOR. See this answer of this previous post for more information. Seeing that the user that has an HTC One S device wich runs Android 4.0, maybe this is the source of your problem.

Android App not working when downloaded via App Store or Google Play - ANR

I have an OpenGL based application which is working fine when I compile and build from eclipse and install it on my android device, however, when I try to publish the same app and install over the Google-Play, the application seems to crash, without giving an ANR dialog. I even tried installing my signed .apk from USB and it all works fine there.
But the published Google-Play version is not working.
Is there any way that I can add some debug outputs on the published Google-play version?
I don't see any force-close or anything, it simply quits and following is the log.
It seems to be crashing at my native c++ functions:
06-20 12:27:36.859: D/SensorManager(14842): ====>>>>>Num Sensor: 1
06-20 12:27:36.859: D/SensorManager(14842): ====>>>>>Num Sensor: 2
06-20 12:27:36.869: D/SensorManager(14842): ====>>>>>Num Sensor: 3
06-20 12:27:36.869: D/SensorManager(14842): ====>>>>>Num Sensor: 4
06-20 12:27:36.869: D/SensorManager(14842): ====>>>>>Num Sensor: 5
06-20 12:27:36.869: D/SensorManager(14842): ====>>>>>Num Sensor: 6
06-20 12:27:36.869: D/SensorManager(14842): ====>>>>>Num Sensor: 0
06-20 12:27:36.889: I/GLThread(14842): noticed surfaceView surface lost tid=11
06-20 12:27:36.969: I/GLThread(14842): noticed surfaceView surface acquired tid=11
06-20 12:27:36.969: W/EglHelper(14842): start() tid=11
06-20 12:27:38.019: W/dalvikvm(14842): threadid=6: spin on suspend #1 threadid=9 (pcf=0)
06-20 12:27:38.769: W/dalvikvm(14842): threadid=6: spin on suspend #2 threadid=9 (pcf=0)
06-20 12:27:38.769: I/dalvikvm(14842): "Compiler" daemon prio=5 tid=6 VMWAIT
06-20 12:27:38.769: I/dalvikvm(14842): | group="system" sCount=0 dsCount=0 obj=0x40510ff0 self=0x1a7d20
06-20 12:27:38.769: I/dalvikvm(14842): | sysTid=14847 nice=0 sched=0/0 cgrp=default handle=619240
06-20 12:27:38.769: I/dalvikvm(14842): at dalvik.system.NativeStart.run(Native Method)
06-20 12:27:38.769: I/dalvikvm(14842): "Thread-10" prio=5 tid=9 RUNNABLE
06-20 12:27:38.769: I/dalvikvm(14842): | group="main" sCount=1 dsCount=0 obj=0x4052aa30 self=0x1e8c68
06-20 12:27:38.769: I/dalvikvm(14842): | sysTid=14850 nice=0 sched=0/0 cgrp=default handle=2001728
06-20 12:27:38.779: I/dalvikvm(14842): at surreal.quake3.engine.Camera9.nativeInit(Native Method)
06-20 12:27:38.779: I/dalvikvm(14842): at surreal.quake3.engine.Camera9.<init>((null):-1)
06-20 12:27:38.779: I/dalvikvm(14842): at surreal.quake3.engine.CameraVFP.<init>((null):-1)
06-20 12:27:38.779: I/dalvikvm(14842): at surreal.quake3.engine.c.run((null):-1)
06-20 12:27:39.529: W/dalvikvm(14842): threadid=6: spin on suspend #3 threadid=9 (pcf=0)
06-20 12:27:39.529: I/dalvikvm(14842): "Compiler" daemon prio=5 tid=6 VMWAIT
06-20 12:27:39.529: I/dalvikvm(14842): | group="system" sCount=0 dsCount=0 obj=0x40510ff0 self=0x1a7d20
06-20 12:27:39.529: I/dalvikvm(14842): | sysTid=14847 nice=0 sched=0/0 cgrp=default handle=619240
06-20 12:27:39.529: I/dalvikvm(14842): at dalvik.system.NativeStart.run(Native Method)
06-20 12:27:39.529: I/dalvikvm(14842): "Thread-10" prio=5 tid=9 RUNNABLE
06-20 12:27:39.529: I/dalvikvm(14842): | group="main" sCount=1 dsCount=0 obj=0x4052aa30 self=0x1e8c68
06-20 12:27:39.529: I/dalvikvm(14842): | sysTid=14850 nice=0 sched=0/0 cgrp=default handle=2001728
06-20 12:27:39.539: I/dalvikvm(14842): at surreal.quake3.engine.Camera9.nativeInit(Native Method)
06-20 12:27:39.539: I/dalvikvm(14842): at surreal.quake3.engine.Camera9.<init>((null):-1)
06-20 12:27:39.539: I/dalvikvm(14842): at surreal.quake3.engine.CameraVFP.<init>((null):-1)
06-20 12:27:39.539: I/dalvikvm(14842): at surreal.quake3.engine.c.run((null):-1)
06-20 12:27:40.299: W/dalvikvm(14842): threadid=6: spin on suspend #4 threadid=9 (pcf=0)
06-20 12:27:40.299: I/dalvikvm(14842): "Compiler" daemon prio=5 tid=6 VMWAIT
06-20 12:27:40.299: I/dalvikvm(14842): | group="system" sCount=0 dsCount=0 obj=0x40510ff0 self=0x1a7d20
06-20 12:27:40.299: I/dalvikvm(14842): | sysTid=14847 nice=0 sched=0/0 cgrp=default handle=619240
06-20 12:27:40.299: I/dalvikvm(14842): at dalvik.system.NativeStart.run(Native Method)
06-20 12:27:40.299: I/dalvikvm(14842): "Thread-10" prio=5 tid=9 RUNNABLE
06-20 12:27:40.299: I/dalvikvm(14842): | group="main" sCount=1 dsCount=0 obj=0x4052aa30 self=0x1e8c68
06-20 12:27:40.299: I/dalvikvm(14842): | sysTid=14850 nice=0 sched=0/0 cgrp=default handle=2001728
06-20 12:27:40.519: I/dalvikvm(14842): at surreal.quake3.engine.Camera9.nativeInit(Native Method)
06-20 12:27:40.519: I/dalvikvm(14842): at surreal.quake3.engine.Camera9.<init>((null):-1)
06-20 12:27:40.519: I/dalvikvm(14842): at surreal.quake3.engine.CameraVFP.<init>((null):-1)
06-20 12:27:40.519: I/dalvikvm(14842): at surreal.quake3.engine.c.run((null):-1)
06-20 12:27:41.269: W/dalvikvm(14842): threadid=6: spin on suspend #5 threadid=9 (pcf=0)
06-20 12:27:41.269: I/dalvikvm(14842): "Compiler" daemon prio=5 tid=6 VMWAIT
06-20 12:27:41.269: I/dalvikvm(14842): | group="system" sCount=0 dsCount=0 obj=0x40510ff0 self=0x1a7d20
06-20 12:27:41.269: I/dalvikvm(14842): | sysTid=14847 nice=0 sched=0/0 cgrp=default handle=619240
06-20 12:27:41.269: I/dalvikvm(14842): at dalvik.system.NativeStart.run(Native Method)
06-20 12:27:41.269: I/dalvikvm(14842): "Thread-10" prio=5 tid=9 RUNNABLE
06-20 12:27:41.269: I/dalvikvm(14842): | group="main" sCount=1 dsCount=0 obj=0x4052aa30 self=0x1e8c68
06-20 12:27:41.269: I/dalvikvm(14842): | sysTid=14850 nice=0 sched=0/0 cgrp=default handle=2001728
06-20 12:27:42.319: I/dalvikvm(14842): at surreal.quake3.engine.Camera9.nativeInit(Native Method)
06-20 12:27:42.319: I/dalvikvm(14842): at surreal.quake3.engine.Camera9.<init>((null):-1)
06-20 12:27:42.319: I/dalvikvm(14842): at surreal.quake3.engine.CameraVFP.<init>((null):-1)
06-20 12:27:42.319: I/dalvikvm(14842): at surreal.quake3.engine.c.run((null):-1)
06-20 12:27:43.069: W/dalvikvm(14842): threadid=6: spin on suspend #6 threadid=9 (pcf=0)
06-20 12:27:43.069: I/dalvikvm(14842): "Compiler" daemon prio=5 tid=6 VMWAIT
06-20 12:27:43.069: I/dalvikvm(14842): | group="system" sCount=0 dsCount=0 obj=0x40510ff0 self=0x1a7d20
06-20 12:27:43.069: I/dalvikvm(14842): | sysTid=14847 nice=0 sched=0/0 cgrp=default handle=619240
06-20 12:27:43.069: I/dalvikvm(14842): at dalvik.system.NativeStart.run(Native Method)
06-20 12:27:43.069: I/dalvikvm(14842): "Thread-10" prio=5 tid=9 RUNNABLE
06-20 12:27:43.069: I/dalvikvm(14842): | group="main" sCount=1 dsCount=0 obj=0x4052aa30 self=0x1e8c68
06-20 12:27:43.069: I/dalvikvm(14842): | sysTid=14850 nice=0 sched=0/0 cgrp=default handle=2001728
06-20 12:27:43.139: I/dalvikvm(14842): at surreal.quake3.engine.Camera9.nativeInit(Native Method)
06-20 12:27:43.139: I/dalvikvm(14842): at surreal.quake3.engine.Camera9.<init>((null):-1)
06-20 12:27:43.139: I/dalvikvm(14842): at surreal.quake3.engine.CameraVFP.<init>((null):-1)
06-20 12:27:43.139: I/dalvikvm(14842): at surreal.quake3.engine.c.run((null):-1)
06-20 12:27:43.899: W/dalvikvm(14842): threadid=6: spin on suspend #7 threadid=9 (pcf=0)
06-20 12:27:43.899: I/dalvikvm(14842): "Compiler" daemon prio=5 tid=6 VMWAIT
06-20 12:27:43.899: I/dalvikvm(14842): | group="system" sCount=0 dsCount=0 obj=0x40510ff0 self=0x1a7d20
06-20 12:27:43.899: I/dalvikvm(14842): | sysTid=14847 nice=0 sched=0/0 cgrp=default handle=619240
06-20 12:27:43.899: I/dalvikvm(14842): at dalvik.system.NativeStart.run(Native Method)
06-20 12:27:43.899: I/dalvikvm(14842): "Thread-10" prio=5 tid=9 RUNNABLE
06-20 12:27:43.899: I/dalvikvm(14842): | group="main" sCount=1 dsCount=0 obj=0x4052aa30 self=0x1e8c68
06-20 12:27:43.899: I/dalvikvm(14842): | sysTid=14850 nice=0 sched=0/0 cgrp=default handle=2001728
06-20 12:27:43.899: I/dalvikvm(14842): at surreal.quake3.engine.Camera9.nativeInit(Native Method)
06-20 12:27:43.899: I/dalvikvm(14842): at surreal.quake3.engine.Camera9.<init>((null):-1)
06-20 12:27:43.899: I/dalvikvm(14842): at surreal.quake3.engine.CameraVFP.<init>((null):-1)
06-20 12:27:43.899: I/dalvikvm(14842): at surreal.quake3.engine.c.run((null):-1)
06-20 12:27:44.649: W/dalvikvm(14842): threadid=6: spin on suspend #8 threadid=9 (pcf=0)
06-20 12:27:44.649: I/dalvikvm(14842): "Compiler" daemon prio=5 tid=6 VMWAIT
06-20 12:27:44.649: I/dalvikvm(14842): | group="system" sCount=0 dsCount=0 obj=0x40510ff0 self=0x1a7d20
06-20 12:27:44.649: I/dalvikvm(14842): | sysTid=14847 nice=0 sched=0/0 cgrp=default handle=619240
06-20 12:27:44.649: I/dalvikvm(14842): at dalvik.system.NativeStart.run(Native Method)
06-20 12:27:44.649: I/dalvikvm(14842): "Thread-10" prio=5 tid=9 RUNNABLE
06-20 12:27:44.649: I/dalvikvm(14842): | group="main" sCount=1 dsCount=0 obj=0x4052aa30 self=0x1e8c68
06-20 12:27:44.649: I/dalvikvm(14842): | sysTid=14850 nice=0 sched=0/0 cgrp=default handle=2001728
06-20 12:27:44.679: I/dalvikvm(14842): at surreal.quake3.engine.Camera9.nativeInit(Native Method)
06-20 12:27:44.679: I/dalvikvm(14842): at surreal.quake3.engine.Camera9.<init>((null):-1)
06-20 12:27:44.679: I/dalvikvm(14842): at surreal.quake3.engine.CameraVFP.<init>((null):-1)
06-20 12:27:44.679: I/dalvikvm(14842): at surreal.quake3.engine.c.run((null):-1)
wow, this is a quite typical situation of native C code where you usually test the application compiling in debug mode and deliver in release mode.
Usually it changes a lot the optimization flags used by the compiler and the application becomes sensible to wrong memory pointers, NULL initialization and so on.
I advice to:
Check if the android.mk file used for debugging and production, to compile your library has the same optimization settings. Check for the optimization level (i.e. LOCAL_CFLAGS += -O3)
take the apk you upload on the market and install the application from the apk. IN this way you can safely exclude any alteration (if any) done by the market itself
If using OpenGL, it did happen to me once that the application crashes due to an OpenGL driver crash. In this case it is very hard to check the root causes of the problem. In my case it was due to a wrong VBO Identifier pointing to a dirty memory location. In my case, no ANR was generated too.
Check for any "out of memory" situation. Again, sometimes, in C you have variables init to zero when you are in debugging and you use them to malloc memory. If you did not init them yourself, when you go and use it whit a compiled for release library, you will get a lot of surprises. One of them could be your crash type.
Check for any other elements triggered by the "release" version. In one of my previous application, the application crashed due to an admob (advertisement) error which was not present in the test mode of the admob SDK. This could explain your behavior too.
I hope this helps in some way.
Cheers
Maurizio

out of memory on every other run, on Android

my app runs fine the first run, but if i restart it crashes and makes me force close. after i hit the force close button then i can start the app again. if i then try to restart after hitting the back button i have to force close. i lets me run it without error every other attempt. i thought android was supposed to take care of returning memory to the computer so we dont have to do that housekeeping: i do have a somewhat large array:
int worldgrid= new int[640][480][3];
in my constructor, i may have to shorten it. i does work the first attempt though. log cat messages:
05-08 19:09:46.035: E/dalvikvm-heap(420): Out of memory on a 28-byte
allocation.
05-08 19:09:46.195: I/dalvikvm(420): | group="main" sCount=0
dsCount=0 s=N obj=0x4001d8e0 self=0xccb0 05-08 19:09:46.195:
I/dalvikvm(420): | sysTid=420 nice=0 sched=0/0 cgrp=default
handle=-1345026008 05-08 19:09:46.205: I/dalvikvm(420): |
schedstat=( 52616400652 22917249866 1196 ) 05-08 19:09:46.205:
I/dalvikvm(420): at java.lang.reflect.Array.createMultiArray(Native
Method) 05-08 19:09:46.205: I/dalvikvm(420): at
java.lang.reflect.Array.newInstance(Array.java:444) 05-08
19:09:46.455: I/dalvikvm(420): at
com.gravedigger.MainGamePanel.(MainGamePanel.java:215) 05-08
19:09:46.455: I/dalvikvm(420): at
com.digger.DiggerActivity.onCreate(GravediggerActivity.java:116) 05-08
19:09:46.615: I/dalvikvm(420): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-08 19:09:46.625: I/dalvikvm(420): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-08 19:09:46.765: I/dalvikvm(420): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-08 19:09:46.765: I/dalvikvm(420): at
android.app.ActivityThread.access$2300(ActivityThread.java:125) 05-08
19:09:46.775: I/dalvikvm(420): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-08 19:09:46.775: I/dalvikvm(420): at
android.os.Handler.dispatchMessage(Handler.java:99) 05-08
19:09:46.785: I/dalvikvm(420): at
android.os.Looper.loop(Looper.java:123) 05-08 19:09:46.785:
I/dalvikvm(420): at
android.app.ActivityThread.main(ActivityThread.java:4627) 05-08
19:09:46.895: I/dalvikvm(420): at
java.lang.reflect.Method.invokeNative(Native Method) 05-08
19:09:46.895: I/dalvikvm(420): at
java.lang.reflect.Method.invoke(Method.java:521) 05-08 19:09:46.895:
I/dalvikvm(420): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-08 19:09:46.895: I/dalvikvm(420): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 05-08
19:09:46.905: I/dalvikvm(420): at
dalvik.system.NativeStart.main(Native Method) 05-08 19:09:47.038:
E/dalvikvm(420): HeapWorker is wedged: 11152ms spent inside
Lcom/android/internal/os/BinderInternal$GcWatcher;.finalize()V 05-08
19:09:47.038: I/dalvikvm(420): DALVIK THREADS: 05-08 19:09:47.045:
I/dalvikvm(420): "main" prio=5 tid=1 VMWAIT
05-08 19:09:47.045: I/dalvikvm(420): | group="main" sCount=1
dsCount=0 s=N obj=0x4001d8e0 self=0xccb0 05-08 19:09:47.045:
I/dalvikvm(420): | sysTid=420 nice=0 sched=0/0 cgrp=default
handle=-1345026008 05-08 19:09:47.045: I/dalvikvm(420): |
schedstat=( 52980087202 23270903160 1219 ) 05-08 19:09:47.045:
I/dalvikvm(420): at java.lang.reflect.Array.createMultiArray(Native
Method) 05-08 19:09:47.045: I/dalvikvm(420): at
java.lang.reflect.Array.newInstance(Array.java:444) 05-08
19:09:47.045: I/dalvikvm(420): at
com.digger.MainGamePanel.(MainGamePanel.java:215) 05-08
19:09:47.045: I/dalvikvm(420): at
com.digger.DiggerActivity.onCreate(GravediggerActivity.java:116) 05-08
19:09:47.045: I/dalvikvm(420): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-08 19:09:47.185: I/dalvikvm(420): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-08 19:09:47.185: I/dalvikvm(420): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-08 19:09:47.195: I/dalvikvm(420): at
android.app.ActivityThread.access$2300(ActivityThread.java:125) 05-08
19:09:47.195: I/dalvikvm(420): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-08 19:09:47.195: I/dalvikvm(420): at
android.os.Handler.dispatchMessage(Handler.java:99) 05-08
19:09:47.195: I/dalvikvm(420): at
android.os.Looper.loop(Looper.java:123) 05-08 19:09:47.195:
I/dalvikvm(420): at
android.app.ActivityThread.main(ActivityThread.java:4627) 05-08
19:09:47.195: I/dalvikvm(420): at
java.lang.reflect.Method.invokeNative(Native Method) 05-08
19:09:47.195: I/dalvikvm(420): at
java.lang.reflect.Method.invoke(Method.java:521) 05-08 19:09:47.195:
I/dalvikvm(420): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-08 19:09:47.195: I/dalvikvm(420): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 05-08
19:09:47.195: I/dalvikvm(420): at
dalvik.system.NativeStart.main(Native Method) 05-08 19:09:47.195:
I/dalvikvm(420): "Binder Thread #2" prio=5 tid=6 NATIVE 05-08
19:09:47.195: I/dalvikvm(420): | group="main" sCount=1 dsCount=0 s=N
obj=0x44f366b8 self=0x11d230 05-08 19:09:47.195: I/dalvikvm(420): |
sysTid=425 nice=0 sched=0/0 cgrp=default handle=1297528 05-08
19:09:47.195: I/dalvikvm(420): | schedstat=( 118912719 416670422 51
) 05-08 19:09:47.195: I/dalvikvm(420): at
dalvik.system.NativeStart.run(Native Method) 05-08 19:09:47.195:
I/dalvikvm(420): "Binder Thread #1" prio=5 tid=5 NATIVE 05-08
19:09:47.195: I/dalvikvm(420): | group="main" sCount=1 dsCount=0 s=N
obj=0x44f36480 self=0x11fd80 05-08 19:09:47.750: I/dalvikvm(420): |
sysTid=424 nice=0 sched=0/0 cgrp=default handle=1269616 05-08
19:09:47.750: I/dalvikvm(420): | schedstat=( 114332827 305656917 35
) 05-08 19:09:47.750: I/dalvikvm(420): at
dalvik.system.NativeStart.run(Native Method) 05-08 19:09:47.755:
I/dalvikvm(420): "JDWP" daemon prio=5 tid=4 VMWAIT 05-08 19:09:47.755:
I/dalvikvm(420): | group="system" sCount=1 dsCount=0 s=N
obj=0x44f352a0 self=0x135ad0 05-08 19:09:47.755: I/dalvikvm(420): |
sysTid=423 nice=0 sched=0/0 cgrp=default handle=1196352 05-08
19:09:47.765: I/dalvikvm(420): | schedstat=( 59551849 158373474 18 )
05-08 19:09:47.765: I/dalvikvm(420): at
dalvik.system.NativeStart.run(Native Method) 05-08 19:09:47.775:
I/dalvikvm(420): "Signal Catcher" daemon prio=5 tid=3 VMWAIT 05-08
19:09:47.886: I/dalvikvm(420): | group="system" sCount=1 dsCount=0
s=N obj=0x44f351e8 self=0x125550 05-08 19:09:47.886: I/dalvikvm(420):
| sysTid=422 nice=0 sched=0/0 cgrp=default handle=1240608 05-08
19:09:47.886: I/dalvikvm(420): | schedstat=( 2639901 40055709 3 )
05-08 19:09:47.886: I/dalvikvm(420): at
dalvik.system.NativeStart.run(Native Method) 05-08 19:09:47.886:
I/dalvikvm(420): "HeapWorker" daemon prio=5 tid=2 RUNNABLE 05-08
19:09:47.886: I/dalvikvm(420): | group="system" sCount=0 dsCount=0
s=N obj=0x438b8e50 self=0x12ece0 05-08 19:09:47.886: I/dalvikvm(420):
| sysTid=421 nice=0 sched=0/0 cgrp=default handle=1195896 05-08
19:09:47.906: I/dalvikvm(420): | schedstat=( 4477669539 2785983510
211 ) 05-08 19:09:47.906: I/dalvikvm(420): at
com.android.internal.os.BinderInternal$GcWatcher.finalize(BinderInternal.java:~48)
05-08 19:09:47.906: I/dalvikvm(420): at
dalvik.system.NativeStart.run(Native Method) 05-08 19:09:47.906:
D/dalvikvm(420): threadid=2: sending two SIGSTKFLTs to threadid=2
(tid=421) to cause debuggerd dump 05-08 19:09:57.895: D/dalvikvm(420):
Sent, pausing to let debuggerd run 05-08 19:10:05.956:
D/dalvikvm(420): Continuing 05-08 19:10:05.956: E/dalvikvm(420): VM
aborting
Probably, not good to have so pretty big arrays in memory.
But anyway, you can decrease memory usage by refactoring your array this way:
int worldgrid = new int[3][480][640];
This trick will reduce memory usage in several times. It's related with java memory overhead for arrays and each item, details can be found here.
http://www.javamex.com/tutorials/memory/array_memory_usage.shtml
Also check, that you don't keep any link to array, it will prevent removing it from memory. Also garbage collector doesn't remove from memory right after removing all links. So, if you don't make link to array equal to null, it's kept in memory and when you restart your app (there is no guaranty that activity was killed fully), and try to create array in onCreate (as I see from log) the old array can be not yet removed.
I can't tell you why you are getting the error every other time without seeing the rest of your code. Do you have static variables you are using?
However I can give you advice on lessening your memory consumption by a factor of 3. It looks like you are attempting to store an rgb image. The problem is each red, green, or blue pixel only needs one byte, but you are giving it an int which is 4 bytes. A better approach is to encode the red, green, and blue into a single int using: int color = Color.rgb(red, geen, blue)That way you only need to initialize your array to int[] worldgrid= new int[640][480] and you cut down the memory usage by a factor of 3.
In addition, you should probably not even store it as a multi-dimensional array at all, and just do int[] worldgrid = new int[640*480];and when indexing into array, just do: int result = worldgrid[row + col*640];

Categories

Resources