Android GoogleAnalytics getInstance

后端 未结 5 1144
离开以前
离开以前 2020-12-09 08:48

in Application class, in create method I call GoogleAnalytics.getInstance(this) and application just freezes...on any device Worked fine with google play services 6.1, now i

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-09 09:12

    GoogleAnalytics.getInstance() deadlocks while trying to parse the xml tracker definition.

    The issue is fixed in Google Play Services 7.0 that was released March 19, 2015. Upgrading to 7.0 will fix the deadlock. http://developer.android.com/google/play-services/index.html

    If you must use Play Services 6.5, you can workaround the deadlock by initializing the tracker from code instead of xml resource:

    public static final String TRACKER_ID="UA-xxx";
    ...
    mTracker = analytics.newTracker(TRACKER_ID);
    // Configure mTracker using the tracker provided methods
    

提交回复
热议问题