我在我的項目中使用谷歌分析,我得到了「套接字或流問題」。錯誤信息。Android和谷歌分析:可以跟蹤事件
W/GoogleAnalyticsTracker(416): Problem with socket or streams.
W/GoogleAnalyticsTracker(416): java.net.SocketException: Host is unresolved: www.google-analytics.com
W/GoogleAnalyticsTracker(416): at java.net.Socket.connect(Socket.java:966)
W/GoogleAnalyticsTracker(416): at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
W/GoogleAnalyticsTracker(416): at com.google.android.apps.analytics.PipelinedRequester.maybeOpenConnection(Unknown Source)
W/GoogleAnalyticsTracker(416): at com.google.android.apps.analytics.PipelinedRequester.addRequest(Unknown Source)
W/GoogleAnalyticsTracker(416): at com.google.android.apps.analytics.NetworkDispatcher$DispatcherThread$AsyncDispatchTask.dispatchSomePendingHits(Unknown Source)
W/GoogleAnalyticsTracker(416): at com.google.android.apps.analytics.NetworkDispatcher$DispatcherThread$AsyncDispatchTask.run(Unknown Source)
W/GoogleAnalyticsTracker(416): at android.os.Handler.handleCallback(Handler.java:587)
W/GoogleAnalyticsTracker(416): at android.os.Handler.dispatchMessage(Handler.java:92)
W/GoogleAnalyticsTracker(416): at android.os.Looper.loop(Looper.java:123)
W/GoogleAnalyticsTracker(416): at android.os.HandlerThread.run(HandlerThread.java:60)
您有這方面的經驗嗎?
謝謝。
編輯:
這裏是我使用的代碼:
GoogleAnalyticsTracker tracker;
tracker = GoogleAnalyticsTracker.getInstance();
tracker.startNewSession("xxxxxxxxxxxxx",context);
tracker.trackPageView("/HomeScreen");
tracker.dispatch();
發佈您正在使用的代碼,導致此錯誤。 – FoamyGuy
@FoamyGuy,謝謝你的回覆。我編輯了我的問題。 –
您的清單中是否有Internet權限? – FoamyGuy