runt18 / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
0 stars 0 forks source link

"androidApplicationContext must be not null" crash in Android console #378

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Name of affected component: Mobile Tracking

Name of related library and version, if applicable (e.g. Android, iOS,
Snippets, etc.): Android, 3.01

Issue summary:

After we updated GA and issued an update of our app then we have 25 of these 
crashes last week. They don't seem related to our code. We have 2 million 
active users so it's a small crash report percentage but it is still our top 
crash based on the Google Play Developer Console numbers.

Here is the stack: 

ava.lang.IllegalArgumentException: androidApplicationContext must be not null!
at 
org.apache.http.impl.client.naf.gba.connector.GbaServiceConnectorSynchronizedSin
gleton.instance(GbaServiceConnectorSynchronizedSingleton.java:75)
at 
org.apache.http.impl.client.naf.gba.shared.KeeperManager.init(KeeperManager.java
:67)
at 
org.apache.http.impl.client.naf.auth.NafHttpAuthStrategyDefault.initSharedResour
ces(NafHttpAuthStrategyDefault.java:118)
at 
org.apache.http.impl.client.naf.auth.NafHttpAuthStrategyDefault.<init>(NafHttpAu
thStrategyDefault.java:94)
at 
org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:16
6)
at 
org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:123)
at 
com.google.analytics.tracking.android.PersistentAnalyticsStore.<init>(Persistent
AnalyticsStore.java:119)
at 
com.google.analytics.tracking.android.PersistentAnalyticsStore.<init>(Persistent
AnalyticsStore.java:96)
at 
com.google.analytics.tracking.android.GAServiceManager.getStore(GAServiceManager
.java:173)
at 
com.google.analytics.tracking.android.GAServiceProxy.useStore(GAServiceProxy.jav
a:315)
at 
com.google.analytics.tracking.android.GAServiceProxy.onConnectionFailed(GAServic
eProxy.java:392)
at 
com.google.analytics.tracking.android.AnalyticsGmsCoreClient.connect(AnalyticsGm
sCoreClient.java:90)
at 
com.google.analytics.tracking.android.GAServiceProxy.connectToService(GAServiceP
roxy.java:330)
at 
com.google.analytics.tracking.android.GAServiceProxy.access$600(GAServiceProxy.j
ava:28)
at 
com.google.analytics.tracking.android.GAServiceProxy$ReconnectTask.run(GAService
Proxy.java:415)
at java.util.Timer$TimerImpl.run(Timer.java:284)

Original issue reported on code.google.com by cnord...@gmail.com on 9 Dec 2013 at 9:43

GoogleCodeExporter commented 8 years ago
We are also seeing this. We use OkHttp extensively and I suspect that it's this 
interaction that's causing this.

This makes analytics unusable for us since it causes a massive number of 
crashes so we have to rip out Analytics until this is resolved.

Original comment by ha...@fogcreek.com on 16 Dec 2013 at 12:47

GoogleCodeExporter commented 8 years ago
Is it possible to get a confirmation if this is a GA issue or we can somehow 
avoid this in our code? We have to remove GA until we know the reason for this. 

Original comment by cnord...@gmail.com on 30 Jan 2014 at 5:10

GoogleCodeExporter commented 8 years ago
This seems to happen when using a library like OkHTTP with Analytics on devices 
that don't use the standard HTTP impl.

Applying all known workarounds does not resolve the issue.  We still see see it 
happen mostly on Samsung T999 (S3) and T899 (Note 2).

We cannot use Analytics as there is no workaround that reliably works.

Original comment by ha...@fogcreek.com on 5 Mar 2014 at 1:09

GoogleCodeExporter commented 8 years ago
FWIW, I have also seen this, but in a different way. 

I am using an older libGoogleAnalytics.jar (46189 bytes, MD5 sha1 
8d0254fe638021ff2ae4fe5bd53c2937006fdab5), but the stack doesn't include GA 
code:

java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:299)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
at java.util.concurrent.FutureTask.run(FutureTask.java:239)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:856)
Caused by: java.lang.IllegalArgumentException: androidApplicationContext must 
be not null!
at 
org.apache.http.impl.client.naf.gba.connector.GbaServiceConnectorSynchronizedSin
gleton.instance(GbaServiceConnectorSynchronizedSingleton.java:76)
at 
org.apache.http.impl.client.naf.gba.shared.KeeperManager.init(KeeperManager.java
:68)
at 
org.apache.http.impl.client.naf.auth.NafHttpAuthStrategyDefault.initSharedResour
ces(NafHttpAuthStrategyDefault.java:119)
at 
org.apache.http.impl.client.naf.auth.NafHttpAuthStrategyDefault.<init>(NafHttpAu
thStrategyDefault.java:95)
at 
org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:16
4)
at 
org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:133)
at com.acmeaom.android.myradar.app.modules.motd.Motd.fetch(ProGuard:93)
at com.acmeaom.android.myradar.app.modules.motd.Motd.access$000(ProGuard:38)
at 
com.acmeaom.android.myradar.app.modules.motd.Motd$1.doInBackground(ProGuard:55)
at 
com.acmeaom.android.myradar.app.modules.motd.Motd$1.doInBackground(ProGuard:53)
at android.os.AsyncTask$2.call(AsyncTask.java:287)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)

Original comment by nmr8a...@gmail.com on 10 Aug 2014 at 6:56

GoogleCodeExporter commented 8 years ago
(And I am not using OkHttp, but I am using Volley.)

Original comment by nmr8a...@gmail.com on 10 Aug 2014 at 6:57

GoogleCodeExporter commented 8 years ago
Related SO question 
http://stackoverflow.com/questions/18000689/illegalargumentexception-when-instan
ciating-httpclient-in-android

The answer there says that this is due to a bad custom HttpClient running on 
some phones, e.g. "T-Mobile MyTouch Q", and suggests a workaround

Original comment by nmr8a...@gmail.com on 10 Aug 2014 at 7:00