Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
805 views
in Technique[技术] by (71.8m points)

google analytics - Android GoogleAnalytics getInstance

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 it's 6.5 and I have no idea what could cause this.... Any ideas?

public class BaseApplication extends Application {

    private static Tracker mTracker;
    private MyProfile mMyProfile;

    public BaseApplication() {
        super();
    }

    private void initTracker() {
        if (mTracker == null) {
            GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
            mTracker = analytics.newTracker(R.xml.global_tracker);
            mTracker.enableAdvertisingIdCollection(true);
        }
    }

`...

Gradle 
dependencies {
    compile project(':IMFramework')
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.google.android.gms:play-services-base:6.5.87'
    compile 'com.google.android.gms:play-services-maps:6.5.87'
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Worked fine with google play services 6.1

Good, I did rollback to 6.1.+ I think it some internal error that will be fixed in an next update.

Upd

It fixed in 7.0


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...