1

我正在使用谷歌分析,但是當我用adb調試時向我顯示這些消息。Android - AnalyticsReceiver未註冊或被禁用?

05-11 14:57:48.911 1681-1912/? W/GAv4-SVC: Network compressed POST connection error: java.net.ConnectException: failed to connect to ssl.google-analytics.com/127.0.0.1 (port 443) after 60000ms: isConnected failed: ECONNREFUSED (Connection refused) 
05-11 14:58:43.591 7281-7281/? I/GAv4: Google Analytics 8.2.98 is starting up. To enable debug logging on a device run: 
             adb shell setprop log.tag.GAv4 DEBUG 
             adb logcat -s GAv4 
05-11 14:58:43.631 7281-7281/? W/GAv4: AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See some url for instructions. 
05-11 14:58:43.681 7281-7281/? D/GAv4: setLocalDispatchPeriod (sec): 60 
05-11 14:58:43.681 7281-7330/? W/GAv4: AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See some url for instructions. 
05-11 14:58:48.131 7237-7268/? I/GAV3: Thread[GAThread,5,main]: No campaign data found. 
05-11 14:59:23.171 7761-7785/? I/GAv4: Google Analytics 8.1.15 is starting up. To enable debug logging on a device run: 
             adb shell setprop log.tag.GAv4 DEBUG 
             adb logcat -s GAv4 
05-11 14:59:23.181 7761-7785/? W/GAv4: AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See some url for instructions. 
05-11 14:59:23.191 7761-7785/? W/GAv4: CampaignTrackingReceiver is not registered, not exported or is disabled. Installation campaign tracking is not possible. See some url for instructions. 
05-11 14:59:23.191 7761-7791/? W/GAv4: AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See some url for instructions. 
05-11 14:59:23.591 7817-7817/com.example.admin.helloanalytics I/GAv4: Google Analytics 8.4.87 is starting up. To enable debug logging on a device run: 
                     adb shell setprop log.tag.GAv4 DEBUG 
                     adb logcat -s GAv4 
05-11 14:59:23.591 7817-7817/com.example.admin.helloanalytics D/GAv4: XML config - app name: XXXXX 
05-11 14:59:23.591 7817-7817/com.example.admin.helloanalytics D/GAv4: XML config - app version: 1.0 
05-11 14:59:23.591 7817-7817/com.example.admin.helloanalytics D/GAv4: XML config - dispatch period (sec): 1800 
05-11 14:59:23.591 7817-7817/com.example.admin.helloanalytics D/GAv4: XML config - dry run: false 
05-11 14:59:23.601 7817-7817/com.example.admin.helloanalytics D/GAv4: setLocalDispatchPeriod (sec): 1800 
05-11 14:59:23.881 7817-7872/com.example.admin.helloanalytics D/GAv4: Hit delivery requested: ht=1462962563740, _s=50, _v=ma8.4.87, a=2122668187, adid=7d85460d-4d41-4d41-8225-b1499b154b44, aid=com.example.admin.helloanalytics, an=XXXXX, ate=1, av=1.0, cd=com.example.admin.helloanalytics.MainActivity, cid=577d2178-6c7e-431d-a258-cea382dd9263, sr=540x960, t=screenview, tid=UA-77544180-1, ul=en-us, v=1 
05-11 14:59:23.921 7817-7872/com.example.admin.helloanalytics D/GAv4: Hit delivery requested: ht=1462962563740, _s=51, _v=ma8.4.87, a=2122668188, adid=7d85460d-4d41-4d41-8225-b1499b154b44, aid=com.example.admin.helloanalytics, an=XXXXX, ate=1, av=1.0, cd=com.example.admin.helloanalytics.MainActivity, cid=577d2178-6c7e-431d-a258-cea382dd9263, sc=start, sr=540x960, t=screenview, tid=UA-77544180-1, ul=en-us, v=1 
05-11 14:59:23.991 7817-7872/com.example.admin.helloanalytics D/GAv4: Hit sent to the device AnalyticsService for delivery 
05-11 14:59:24.531 7817-7872/com.example.admin.helloanalytics D/GAv4: Hit sent to the device AnalyticsService for delivery 
05-11 14:59:24.801 7915-7915/? W/GAV2: Thread[main,5,main]: Need to call initialize() and be in fallback mode to start dispatch. 
05-11 14:59:25.151 7964-7964/? I/GAv4: Google Analytics 8.2.98 is starting up. To enable debug logging on a device run: 
             adb shell setprop log.tag.GAv4 DEBUG 
             adb logcat -s GAv4 
05-11 14:59:25.161 7964-7964/? W/GAv4: AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See some url for instructions. 
05-11 14:59:25.191 7964-7964/? D/GAv4: setLocalDispatchPeriod (sec): 60 
05-11 14:59:25.191 7964-8007/? W/GAv4: AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See some url for instructions. 
05-11 14:59:29.771 7915-7955/? I/GAV2: Thread[GAThread,5,main]: No campaign data found. 
05-11 14:59:49.111 1681-1912/? W/GAv4-SVC: Network compressed POST connection error: java.net.ConnectException: failed to connect to ssl.google-analytics.com/127.0.0.1 (port 443) after 60000ms: isConnected failed: ECONNREFUSED (Connection refused) 
05-11 15:00:12.531 7817-7872/com.example.admin.helloanalytics D/GAv4: Hit delivery requested: ht=1462962612433, _s=52, _v=ma8.4.87, a=2122668189, adid=7d85460d-4d41-4d41-8225-b1499b154b44, aid=com.example.admin.helloanalytics, an=XXXXX, ate=1, av=1.0, cd=com.example.admin.helloanalytics.MainActivity, cid=577d2178-6c7e-431d-a258-cea382dd9263, ea=Share, ec=Action, sr=540x960, t=event, tid=UA-77544180-1, ul=en-us, v=1 
05-11 15:00:12.621 7817-7872/com.example.admin.helloanalytics D/GAv4: Hit sent to the device AnalyticsService for delivery 
05-11 15:00:12.671 7817-7872/com.example.admin.helloanalytics D/GAv4: Hit delivery requested: ht=1462962612569, _s=53, _v=ma8.4.87, a=2122668189, adid=7d85460d-4d41-4d41-8225-b1499b154b44, aid=com.example.admin.helloanalytics, an=XXXXX, ate=1, av=1.0, cd=com.example.admin.helloanalytics.Second, cid=577d2178-6c7e-431d-a258-cea382dd9263, sr=540x960, t=screenview, tid=UA-77544180-1, ul=en-us, v=1 
05-11 15:00:12.691 7817-7872/com.example.admin.helloanalytics D/GAv4: Hit delivery requested: ht=1462962612569, _s=54, _v=ma8.4.87, a=2122668190, adid=7d85460d-4d41-4d41-8225-b1499b154b44, aid=com.example.admin.helloanalytics, an=XXXXX, ate=1, av=1.0, cd=com.example.admin.helloanalytics.Second, cid=577d2178-6c7e-431d-a258-cea382dd9263, sr=540x960, t=screenview, tid=UA-77544180-1, ul=en-us, v=1 
05-11 15:00:12.751 7817-7872/com.example.admin.helloanalytics D/GAv4: Hit sent to the device AnalyticsService for delivery 
05-11 15:00:12.791 7817-7872/com.example.admin.helloanalytics D/GAv4: Hit sent to the device AnalyticsService for delivery 

我的谷歌分析是連接還是爲真?

這裏是我的MainActivity:

import android.content.Intent; 
import android.support.v7.app.AppCompatActivity; 
import android.os.Bundle; 
import android.view.View; 
import android.widget.Button; 
import com.google.android.gms.analytics.HitBuilders; 
import com.google.android.gms.analytics.Tracker; 

public class MainActivity extends AppCompatActivity { 
    private Tracker mTracker; 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_main); 
     Button BTN = (Button) findViewById(R.id.BTN); 
     BTN.setOnClickListener(new View.OnClickListener() { 
      @Override 
      public void onClick(View v) { 
       mTracker.send(new HitBuilders.EventBuilder() 
         .setCategory("Action") 
         .setAction("Share") 
         .build()); 
       Intent intent = new Intent(MainActivity.this,Second.class); 
       startActivity(intent); 
      } 
     }); 


     MobikulApplication mMobikulApplication = (MobikulApplication) getApplication(); 
     mTracker = mMobikulApplication.getDefaultTracker(); 

     String name = this.getClass().getName(); 
     mTracker.setScreenName("" + name); 
     mTracker.send(new HitBuilders.ScreenViewBuilder().build()); 
    } 
} 

這裏是我的analytics_global_config.xml:

<?xml version="1.0" encoding="utf-8" ?> 
<resources> 
    <!-- The application name. Defaults to name specified for the application label --> 
    <string name="ga_appName">XXXXX</string> 

    <!-- The application version. Defaults to android:versionName specified in the 
     AndroidManifest.xml --> 
    <string name="ga_appVersion">1.0</string> 

    <!-- The dispatching period in seconds when Google Play services is unavailable. The 
    default period is 1800 seconds or 30 minutes --> 
    <integer name="ga_dispatchPeriod">1800</integer> 

    <!-- Enable dry run mode. Default is false --> 
    <bool name="ga_dryRun">false</bool> 
</resources> 

而且我在我的應用程序項目中添加JSON。

如果需要查看所有項目,我可以顯示它。

謝謝

+0

檢查此鏈接:http://stackoverflow.com/questions/30154057/analyticsservice-not-registered-in-the-app-manifest-error – KinGPinG

回答

1

請確保您有AnalyticService啓用Manifest

<service android:name="com.google.android.gms.analytics.AnalyticsService" 
      android:enabled="true" 
      android:exported="false"/> 

而且你沒有指定(Tracking ID)

沒有ID就無法跟蹤