Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Troubleshooting

Christian Brevik edited this page Sep 13, 2018 · 7 revisions

Conflicting Google Play Services version on Android?

You can specify googlePlayServicesVersion in "android/gradle.properties". Otherwise, it will take default version

e.g. googlePlayServicesVersion=11.8.0

See this wiki post for more info on handling conflicting versions.

Problems with tracking? Visitors not showing up?

This is NOT (normally) an error with this library. Please read this guide on how to set up your Google Analytics account/property for mobile analytics.

Problems with android build failures?

Here I have mentioned the required steps to resolve the issues regarding the build failures, when you got updated your android studio please check the following doc to clear the issues

Google Analytics Logging

There is a divergence in how the iOS and Android versions of the native library handles logging.

For Android you can check the GA logs with your favorite terminal by using adb logcat.

For iOS there is a logger in the internal library that writes events to the XCode output window. In order to control the logLevel you can add an item in your Info.plist with the key GAILogLevel. The value you use is a number which corresponds to your desired log-level:

  • 0: None
  • 1: Errors
  • 2: Warnings
  • 3: Info
  • 4: Verbose

Android build problem

Some people have had problems being hit with Unknown source file : com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzmu; after installing this (or similar modules).

This might be because you are using another module which also uses play-services, but targets a different version of play-services. In the build.gradle-file of this module, we target com.google.android.gms:play-services-analytics:9.+. In other words, we try to use the latest (9.x.x) version of play-services.

If some other module is targetting a previous version, say 8.3.0, then adding the following to your (React Native-project) build.gradle may be helpful:

compile("com.google.android.gms:play-services-analytics:8.3.0"){
    force = true
}

That should force the app to compile the 8.3.0 version of the dependency my module uses. Obviously, this might not be a solution if several modules are depending on conflicting versions.

I would recommend other module authors which also depend on play-services to target 9.+ instead of a specific minor version.

Clone this wiki locally