2013-04-09 12 views
12

विफल रहा है मैंने अपने एंड्रॉइड ऐप में Google Analytics (V2) लागू किया है। कुछ समय पहले कोड प्रोफाइल (V2) को डेटा भेजने में कामयाब रहा। हालांकि अब यह सेवा से कनेक्ट करने से इनकार:सेवा के लिए एंड्रॉइड Google Analytics कनेक्शन

04-09 14:42:49.911: W/GAV2(8576): Thread[main,5,main]: Need to call initialize() and be in fallback mode to start dispatch. 
04-09 14:42:49.921: I/GAV2(8576): Thread[main,5,main]: ExceptionReporter created, original handler is com.android.internal.os.RuntimeInit$UncaughtHandler 
04-09 14:42:50.051: D/libEGL(8576): loaded /system/lib/egl/libEGL_mali.so 
04-09 14:42:50.061: D/libEGL(8576): loaded /system/lib/egl/libGLESv1_CM_mali.so 
04-09 14:42:50.061: D/libEGL(8576): loaded /system/lib/egl/libGLESv2_mali.so 
04-09 14:42:50.120: D/OpenGLRenderer(8576): Enabling debug mode 0 
04-09 14:42:50.190: W/IInputConnectionWrapper(8576): showStatusIcon on inactive InputConnection 
04-09 14:42:54.881: I/GAV2(8576): Thread[GAThread,5,main]: connecting to Analytics service 
04-09 14:42:54.891: I/GAV2(8576): Thread[GAThread,5,main]: connect: bindService returned false for Intent { act=com.google.android.gms.analytics.service.START (has extras) } 
04-09 14:42:54.901: W/GAV2(8576): Thread[GAThread,5,main]: Service unavailable (code=1), will retry. 
04-09 14:42:54.941: I/GAV2(8576): Thread[GAThread,5,main]: No campaign data found. 
04-09 14:42:59.911: I/GAV2(8576): Thread[Service Reconnect,5,main]: connecting to Analytics service 
04-09 14:42:59.921: I/GAV2(8576): Thread[Service Reconnect,5,main]: connect: bindService returned false for Intent { act=com.google.android.gms.analytics.service.START (has extras) } 
04-09 14:42:59.921: W/GAV2(8576): Thread[Service Reconnect,5,main]: Service unavailable (code=1), using local store. 
04-09 14:42:59.921: I/GAV2(8576): Thread[Service Reconnect,5,main]: falling back to local store 
04-09 14:42:59.971: V/GAV2(8576): Thread[GAThread,5,main]: dispatch running... 
04-09 14:43:00.061: V/GAV2(8576): Thread[GAThread,5,main]: ...nothing to dispatch 
04-09 14:43:00.061: I/GAV2(8576): Thread[GAThread,5,main]: PowerSaveMode initiated. 
04-09 14:43:52.951: D/dalvikvm(8576): GC_CONCURRENT freed 197K, 4% free 7258K/7492K, paused 15ms+5ms, total 56ms 
04-09 14:43:54.611: W/IInputConnectionWrapper(8576): showStatusIcon on inactive InputConnection 

मैं बहुत यकीन है कि मेरे कोड के लिए पर्याप्त है, क्योंकि यह पहले डेटा भेजने में कामयाब रहा हूँ।

प्रकट अतिरिक्त:

<uses-permission android:name="android.permission.INTERNET" /> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 

मुख्य गतिविधि अतिरिक्त:

@Override 
public void onStart() { 

    super.onStart(); 
    EasyTracker.getInstance().activityStart(this); 

} 

@Override 
public void onStop() { 

    EasyTracker.getInstance().activityStop(this); 
    super.onStop(); 
} 

एक्सएमएल (analytics.xml)

ये कदम मैं कार्यान्वित (प्रयुक्त एंड्रॉयड गूगल एनालिटिक्स V2 डॉक्स) कर रहे हैं
<?xml version="1.0" encoding="utf-8" ?> 

<resources> 
    <!--tracking ID--> 
    <string name="ga_trackingId">UA-(copied from profile)-1</string> 

    <!--Enable automatic activity tracking--> 
    <bool name="ga_autoActivityTracking">true</bool> 

    <!--Enable automatic exception tracking--> 
    <bool name="ga_reportUncaughtExceptions">true</bool> 

    <!--Enable debug tracking--> 
    <bool name="ga_debug">true</bool> 

    <integer name="ga_dispatchPeriod">20</integer> 
</resources> 

मुझे ऐप के लॉन्च पर चेतावनियां मिलती हैं। मैंने एक नया प्रोफाइल/खाता बनाने का प्रयास किया है। मैंने & # 45 का उपयोग करने का प्रयास किया है; और & # 8211; डैश के बजाय। प्रोफाइल पर अंतिम डेटा प्राप्त होने के बाद से 30+ घंटे हो गए हैं, तब से उपर्युक्त लॉगक लाइनें।

कोई विचार यह कैसे होता है?

+2

यह उत्तर जांचें: http: // stackoverflow।com/एक/15014918/1168654 –

+0

चेक जवाब यहां पोस्ट: [कड़ी] [1] [1]: http://stackoverflow.com/questions/13222468/android-google- एनालिटिक्स-कनेक्शन करने के लिए सेवा-असफल – Nargis

उत्तर

2

आपका मामला नहीं बन सकता है लेकिन यहां यह वैसे भी चला जाता है।

मेरे पास मेरे ऐप में ठीक काम कर रहा था। मैं ग्रहण का उपयोग कर रहा था और इंटेलिज आईडीई पर स्विच करने का फैसला किया। जब मैंने ऐसा किया, तो आईडीई ने मुझे अपनी analytics.xml फ़ाइल (ga_trackingId के संबंध में) के डैश चरित्र पर एक टाइपोग्राफ चेतावनी दिखायी। जब मैंने परिवर्तन किया (मानव आंखों के लिए अदृश्य) चेतावनी चली गई लेकिन विश्लेषिकी ने अभी काम करना बंद कर दिया।

जो कुछ भी फ़ाइल की एन्कोडिंग के साथ कुछ हो सकता है,, लेकिन मैं अपने मामले मैं प्रकार पानी का छींटा चरित्र पड़ा और नहीं पेस्ट यह (और यह भी एक उपकरण जोड़ें: उपेक्षा = "TypographyDashes" मेरी फाइल में चेतावनी से छुटकारा पाने के लिए)।

0

यह सुनिश्चित नहीं है कि यह महत्वपूर्ण है लेकिन मेरा analytics.xml "xml" के बजाय "मानों" में रहता है और यह ठीक काम करता है।

यहां यह कैसा दिखता है। उम्मीद है की यह मदद करेगा।

<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="TypographyDashes"> 

    <!-- Replace placeholder ID with your tracking ID --> 
    <string name="ga_trackingId">UA-8158474-29</string> 

    <!-- Enable automatic activity tracking --> 
    <bool name="ga_autoActivityTracking">true</bool> 

    <integer name="ga_dispatchPeriod">40</integer> 

    <!-- Enable automatic exception tracking --> 
    <bool name="ga_reportUncaughtExceptions">true</bool> 

</resources> 
0

ga_debug इसे झूठी बनाओ और एक बार प्रयास करें। शायद आप इसे प्राप्त करेंगे।

<!--Enable debug tracking--> 
<bool name="ga_debug">false</bool> 
0

क्या आपने Google Analytics वेब UI पर जांच की है कि आप वास्तव में कुछ भी प्राप्त नहीं कर रहे हैं?

मेरे पास डीबग प्रिंट भी है जो कनेक्टिविटी नहीं बताता है लेकिन मेरा कोड अभी भी काम करता है (और मैं भी EasyTracker का उपयोग करता हूं)। जब मैं इसे वेब यूआई पर देखता हूं तो मुझे घटनाएं मिल रही हैं। क्या यह आपका मामला भी है? दुर्भाग्यवश मुझे नहीं पता कि डीबग का कहना है कि इसका कोई कनेक्शन नहीं है।