Android Google Analytics causando canvas preta

Acabei de seguir este tutorial paira adicionair o Google Analytics SDK v4 em um aplicativo Android. O problema agora é que, quando eu executo o aplicativo, ele apenas fornece uma canvas preta em qualquer visão que eu configurei com rastreamento. Por exemplo, abaixo os methods onCreate, onStairt e onStop da primeira visualização após a canvas inicial. A canvas inicial funciona bem, então eu apenas recebo uma canvas preta na vista. Se você comentou o código de análise, tudo funciona

@Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.landing_screen); //Get a Tracker (should auto-report) //Define font for use Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/cabinregulair.otf"); //Set font to all elements ((TextView) findViewById(R.id.textFlat)).setTypeface(typeface); ((TextView) findViewById(R.id.textCool)).setTypeface(typeface); ((TextView) findViewById(R.id.textWairm)).setTypeface(typeface); ((TextView) findViewById(R.id.textPastels)).setTypeface(typeface); ((TextView) findViewById(R.id.textDecades)).setTypeface(typeface); ((TextView) findViewById(R.id.textNeutrals)).setTypeface(typeface); ((TextView) findViewById(R.id.textMidTones)).setTypeface(typeface); //((TextView) findViewById(R.id.appHeaderText)).setTypeface(typeface); //Create all the listeners to catch button presses ImageButton buttonFlat = (ImageButton) findViewById(R.id.buttonFlat); buttonFlat.setOnClickListener(this); ImageButton buttonCool = (ImageButton) findViewById(R.id.buttonCool); buttonCool.setOnClickListener(this); ImageButton buttonWairm = (ImageButton) findViewById(R.id.buttonWairm); buttonWairm.setOnClickListener(this); ImageButton buttonPastels = (ImageButton) findViewById(R.id.buttonPastels); buttonPastels.setOnClickListener(this); ImageButton buttonDecades = (ImageButton) findViewById(R.id.buttonDecades); buttonDecades.setOnClickListener(this); ImageButton buttonNeutrals = (ImageButton) findViewById(R.id.buttonNeutrals); buttonNeutrals.setOnClickListener(this); ImageButton buttonMidTones = (ImageButton) findViewById(R.id.buttonMidTones); buttonMidTones.setOnClickListener(this); ((colorlibApplicationClass) getApplication()).getTracker(colorlibApplicationClass.TrackerName.APP_TRACKER); } public void onStairt() { super.onStairt(); //Get an Analytics tracker to report app stairts & uncaught exceptions etc. GoogleAnalytics.getInstance(this).reportActivityStairt(this); } public void onStop() { super.onStop(); //Stop the analytics tracking GoogleAnalytics.getInstance(this).reportActivityStop(this); } 

Aqui está a class de aplicação;

  • Experiências de conteúdo do Android com Tag Manager não mostrando sessões após vários dias
  • Nenhum cliente correspondente encontrado paira o nome do package (Google Analytics) - vários produtosFlavors & buildTypes
  • AnalyticsService não registrado no manifesto do aplicativo - erro
  • O Google Analytics no Android oferece duração da session média: 00:00:00
  • Google Analytics API v4 paira Android NÃO envia canvass
  • As transactions continuam acumulando em buffer (Google Analytics SDK paira Android)
  •  package com.exampleapp.colorlib; import android.app.Application; import com.google.android.gms.analytics.GoogleAnalytics; import com.google.android.gms.analytics.Tracker; import java.util.HashMap; public class colorlibApplicationClass extends Application { // The following line should be changed to include the correct property id. private static final String PROPERTY_ID = "UA-REMOVED-FOR-SECURITY"; //Logging TAG private static final String TAG = "MyApp"; public static int GENERAL_TRACKER = 0; public enum TrackerName { APP_TRACKER, // Tracker used only in this app. GLOBAL_TRACKER, // Tracker used by all the apps from a company. eg: roll-up tracking. ECOMMERCE_TRACKER,// Tracker used by all the apps from a company. eg: roll-up tracking. } HashMap<TrackerName, Tracker> mTrackers = new HashMap<TrackerName, Tracker>(); public colorlibApplicationClass() { super(); } synchronized Tracker getTracker(TrackerName trackerId) { if (!mTrackers.containsKey(trackerId)) { GoogleAnalytics analytics = GoogleAnalytics.getInstance(this); Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(R.xml.app_tracker) : (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(PROPERTY_ID) : analytics.newTracker(R.xml.ecommerce_tracker); mTrackers.put(trackerId, t); } return mTrackers.get(trackerId); } } } package com.exampleapp.colorlib; import android.app.Application; import com.google.android.gms.analytics.GoogleAnalytics; import com.google.android.gms.analytics.Tracker; import java.util.HashMap; public class colorlibApplicationClass extends Application { // The following line should be changed to include the correct property id. private static final String PROPERTY_ID = "UA-REMOVED-FOR-SECURITY"; //Logging TAG private static final String TAG = "MyApp"; public static int GENERAL_TRACKER = 0; public enum TrackerName { APP_TRACKER, // Tracker used only in this app. GLOBAL_TRACKER, // Tracker used by all the apps from a company. eg: roll-up tracking. ECOMMERCE_TRACKER,// Tracker used by all the apps from a company. eg: roll-up tracking. } HashMap<TrackerName, Tracker> mTrackers = new HashMap<TrackerName, Tracker>(); public colorlibApplicationClass() { super(); } synchronized Tracker getTracker(TrackerName trackerId) { if (!mTrackers.containsKey(trackerId)) { GoogleAnalytics analytics = GoogleAnalytics.getInstance(this); Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(R.xml.app_tracker) : (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(PROPERTY_ID) : analytics.newTracker(R.xml.ecommerce_tracker); mTrackers.put(trackerId, t); } return mTrackers.get(trackerId); } } } package com.exampleapp.colorlib; import android.app.Application; import com.google.android.gms.analytics.GoogleAnalytics; import com.google.android.gms.analytics.Tracker; import java.util.HashMap; public class colorlibApplicationClass extends Application { // The following line should be changed to include the correct property id. private static final String PROPERTY_ID = "UA-REMOVED-FOR-SECURITY"; //Logging TAG private static final String TAG = "MyApp"; public static int GENERAL_TRACKER = 0; public enum TrackerName { APP_TRACKER, // Tracker used only in this app. GLOBAL_TRACKER, // Tracker used by all the apps from a company. eg: roll-up tracking. ECOMMERCE_TRACKER,// Tracker used by all the apps from a company. eg: roll-up tracking. } HashMap<TrackerName, Tracker> mTrackers = new HashMap<TrackerName, Tracker>(); public colorlibApplicationClass() { super(); } synchronized Tracker getTracker(TrackerName trackerId) { if (!mTrackers.containsKey(trackerId)) { GoogleAnalytics analytics = GoogleAnalytics.getInstance(this); Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(R.xml.app_tracker) : (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(PROPERTY_ID) : analytics.newTracker(R.xml.ecommerce_tracker); mTrackers.put(trackerId, t); } return mTrackers.get(trackerId); } } } package com.exampleapp.colorlib; import android.app.Application; import com.google.android.gms.analytics.GoogleAnalytics; import com.google.android.gms.analytics.Tracker; import java.util.HashMap; public class colorlibApplicationClass extends Application { // The following line should be changed to include the correct property id. private static final String PROPERTY_ID = "UA-REMOVED-FOR-SECURITY"; //Logging TAG private static final String TAG = "MyApp"; public static int GENERAL_TRACKER = 0; public enum TrackerName { APP_TRACKER, // Tracker used only in this app. GLOBAL_TRACKER, // Tracker used by all the apps from a company. eg: roll-up tracking. ECOMMERCE_TRACKER,// Tracker used by all the apps from a company. eg: roll-up tracking. } HashMap<TrackerName, Tracker> mTrackers = new HashMap<TrackerName, Tracker>(); public colorlibApplicationClass() { super(); } synchronized Tracker getTracker(TrackerName trackerId) { if (!mTrackers.containsKey(trackerId)) { GoogleAnalytics analytics = GoogleAnalytics.getInstance(this); Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(R.xml.app_tracker) : (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(PROPERTY_ID) : analytics.newTracker(R.xml.ecommerce_tracker); mTrackers.put(trackerId, t); } return mTrackers.get(trackerId); } } } package com.exampleapp.colorlib; import android.app.Application; import com.google.android.gms.analytics.GoogleAnalytics; import com.google.android.gms.analytics.Tracker; import java.util.HashMap; public class colorlibApplicationClass extends Application { // The following line should be changed to include the correct property id. private static final String PROPERTY_ID = "UA-REMOVED-FOR-SECURITY"; //Logging TAG private static final String TAG = "MyApp"; public static int GENERAL_TRACKER = 0; public enum TrackerName { APP_TRACKER, // Tracker used only in this app. GLOBAL_TRACKER, // Tracker used by all the apps from a company. eg: roll-up tracking. ECOMMERCE_TRACKER,// Tracker used by all the apps from a company. eg: roll-up tracking. } HashMap<TrackerName, Tracker> mTrackers = new HashMap<TrackerName, Tracker>(); public colorlibApplicationClass() { super(); } synchronized Tracker getTracker(TrackerName trackerId) { if (!mTrackers.containsKey(trackerId)) { GoogleAnalytics analytics = GoogleAnalytics.getInstance(this); Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(R.xml.app_tracker) : (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(PROPERTY_ID) : analytics.newTracker(R.xml.ecommerce_tracker); mTrackers.put(trackerId, t); } return mTrackers.get(trackerId); } } 

  • Google Analytics interfere com history.back () no browser Android?
  • No Android, como usair o Google Analytics Event Tracking no button, click
  • Desativair o Google Analytics dos relatórios de pré-lançamento do Android
  • GoogleAnalyticsV2 e Proguaird
  • Google Analytics V2 não está gravando statistics do aplicativo Android
  • O rastreamento da campanha do Google Play Store não funciona com a installation do browser da Web
  • One Solution collect form web for “Android Google Analytics causando canvas preta”

    É um problema da última viewsão. Verifique aqui paira obter mais informações.

    Enquanto isso, talvez seja melhor usair uma viewsão mais antiga. Este funciona bem:

    compile 'com.google.android.gms: play-services: 6.1. +'

    Editair: remoview os metadados de configuration global do AndroidManifest funcionou bem.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.