3

I have the gradle script using

    compile "com.google.android.gms:play-services-tagmanager:10.0.1"

But my app has the imports in red

import com.google.android.gms.tagmanager.DataLayer;
import com.google.android.gms.tagmanager.TagManager;

when I try and find those classes they are not there. Did google move these to somewhere else, are they now in firebase?

JPM
  • 9,077
  • 13
  • 78
  • 137

1 Answers1

3

I couldn't find any documentation or explanation for the change. After some fishing around and looking at library transitive dependencies, I think adding this dependency will resolve the missing imports:

compile 'com.google.android.gms:play-services-tagmanager-v4-impl:10.0.1'

Another option that seems to work is to add ALL of Play Services with:

compile 'com.google.android.gms:play-services:10.0.1'

But that gets you WAY more APIs than you need, will make your APK larger, and possibly require you configure Multidex for pre-Lollipop devices.

Bob Snyder
  • 37,759
  • 6
  • 111
  • 158
  • That is just crazy why is this missing in the first import. Why hasn't google updated their docs for tagmanager it still shows the latest as 9.2.1...lol – JPM Dec 09 '16 at 15:56
  • FYI the amount library methods increased by 3k from 59489 to 62360 just so you know. I'm living on the edge of 65K! And also where did you find this library? I can't find a place for the source code – JPM Dec 09 '16 at 16:31
  • 1
    @JPM: My method was to add a dependency to all of play-services to confirm that the imports were found. Then I did a Ctrl-B on a code occurrence of `TagManager` to open the source file. In the upper right corner, I clicked on _Choose Sources_ and got a dialog showing a directory tree of the libraries. Gradle task `androidDependencies` is also helpful to see the library dependency tree of an app. And the newer versions of AS contain an [APK Analyzer](https://developer.android.com/studio/build/apk-analyzer.html). Sounds like you may already be using it. If not, it offers lots of insights – Bob Snyder Dec 09 '16 at 16:49