I did the same, wrap all analytics calls in a try/catch block,

Mark

On Mon, Jan 3, 2011 at 3:39 AM, blindfold <seeingwithso...@gmail.com> wrote:
> Well, after another user apparently had 6 crashes in 2 minutes from
> GoogleAnalyticsTracker.trackEvent() right when launching my app, I've
> updated my app to wrap all Google Analytics calls in try-catch blocks
> to quench the symptoms. Even though the crash reports were rare, this
> seems to be the only/simplest way for me to avoid an occasional bad
> user experience due to use of Google Analytics.
>
> Regards
>
>
> java.lang.RuntimeException: Unable to start activity
> ComponentInfo{vOICe.vOICe/vOICe.vOICe.The_vOICe}:
> java.lang.IllegalStateException: no transaction pending at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2663) at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2679) at android.app.ActivityThread.access$2300(ActivityThread.java:
> 125) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
> 2033) at android.os.Handler.dispatchMessage(Handler.java:99) at
> android.os.Looper.loop(Looper.java:123) at
> android.app.ActivityThread.main(ActivityThread.java:4627) at
> java.lang.reflect.Method.invokeNative(Native Method) at
> java.lang.reflect.Method.invoke(Method.java:521) at
> com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:878) at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636) at
> dalvik.system.NativeStart.main(Native Method) Caused by:
> java.lang.IllegalStateException: no transaction pending at
> android.database.sqlite.SQLiteDatabase.endTransaction(SQLiteDatabase.java:
> 555) at
> com.google.android.apps.analytics.PersistentEventStore.putEvent(Unknown
> Source) at
> com.google.android.apps.analytics.GoogleAnalyticsTracker.createEvent(Unknown
> Source) at
> com.google.android.apps.analytics.GoogleAnalyticsTracker.trackEvent(Unknown
> Source) at vOICe.vOICe.The_vOICe.a(Unknown Source) at
> vOICe.vOICe.The_vOICe.onCreate(Unknown Source) at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> 1047) at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2627) ... 11 more
>
> FINGERPRINT {verizon/thunderc/thunderc/thunderc:2.2/FRF91/eng.lge.
> 20101101.102025:user/release-keys}
>
>
> On Dec 31 2010, 3:55 pm, blindfold <seeingwithso...@gmail.com> wrote:
>> Hmm, I have only one global tracker object that I create in the
>> onCreate() of my main activity, and with a regular dispatch interval
>> through the format tracker.start("UA-12345-0", nseconds, this), so I'd
>> say that it all works from one alive thread. However, in one pair of
>> crash logs the first GoogleAnalyticsTracker.trackEvent() crash occurs
>> after my app had been running for some time, while the second
>> GoogleAnalyticsTracker.trackEvent() crash occurs immediately at app
>> startup only 3 minutes later, for the same device FINGERPRINT,
>> suggesting that indeed some sort of lock had lived on even across runs
>> to cause a second crash because the second run would not be owning the
>> lingering lock. This was for a Samsung GT-I5800 running Android 2.1-
>> update1.
>>
>> On Dec 31, 3:21 pm, H <m...@howardb.com> wrote:
>>
>> > Looking in the analytics source after you've called trackEvent(), I suspect
>> > that error is coming out when it is using a database transaction to insert
>> > the event into the database. Once inserted, it calls endTransaction as well
>> > as setTransactionSuccessful. Both of these do this check:
>>
>> > if (!mLock.isHeldByCurrentThread()) {
>> >             throw new IllegalStateException("no transaction pending");
>> >         }
>>
>> > So it could be worth checking to see if you are tracking the event from a
>> > thread that has ended, or calling dispatch from a different thread...?
>>
>> > HTH.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to