After days of stress, I've finally fixed the problem. After performing a backtrace on the main thread I discovered the program came to a halt when trying to load the Google Analytics trackers. This is the thread backtrace:
at com.google.android.gms.analytics.ae.getLogger(Unknown Source)
at com.google.android.gms.analytics.ae.W(Unknown Source)
at com.google.android.gms.analytics.z$a.f(Unknown Source) at com.google.android.gms.analytics.n.a(Unknown Source)
at com.google.android.gms.analytics.n.x(Unknown Source)
at com.google.android.gms.analytics.GoogleAnalytics.eZ(Unknown Source)
at com.google.android.gms.analytics.GoogleAnalytics.(Unknown Source)
at com.google.android.gms.analytics.GoogleAnalytics.(Unknown Source)
at com.google.android.gms.analytics.GoogleAnalytics.getInstance(Unknown Source)
I then did some research on this result. It appears to be a bug caused when trying to load the trackers from an xml file. This bug is discussed in more detail here:
- http://stackoverflow.com/questions/27533679/google-analytics-blocks-android-app/27542483#27542483https://stackoverflow.com/questions/27533679/google-analytics-blocks-android-app/27542483#27542483
- https://code.google.com/p/analytics-issues/issues/detail?id=552
To prevent this bug, I no longer load the trackers from their corrosponding xml files by removing this line in the AndroidManifest.xml:
<meta-data
android:name="com.google.android.gms.analytics.globalConfigResource"
android:resource="@xml/analytics_global_config" />
Problem fixed, thanks guys.