4

I am working on a project in which i have used TagManager and Datalayer class for the implementation of GTA and enhanced ecommerce and i am using 'com.google.android.gms:play-services-base:12.0.1' in build.gradle and android studio version 3.0.1 is showing me to update it to 15.0.0 and when i changed its version and sync project it is now giving me error:

error: package com.google.android.gms.tagmanager does not exist

I took update of android studio 3.1.1 and using build tool version 27, but it is making no effect to correct this problem. It is still showing same error message.

build.gradle info:

compileSdkVersion 27
buildToolsVersion "27.0.2"

minSdkVersion 16
targetSdkVersion 27

compile 'com.android.support:appcompat-v7:27.1.1'
compile 'com.android.support:design:27.1.1'
compile 'com.android.support:cardview-v7:27.1.1'
compile 'com.android.support:recyclerview-v7:27.1.1'
compile 'com.android.support:customtabs:27.1.1'

compile 'com.google.android.gms:play-services-auth:15.0.0'
compile 'com.google.android.gms:play-services-base:15.0.0'
compile 'com.google.android.gms:play-services-gcm:15.0.0'
compile 'com.google.android.gms:play-services-analytics:15.0.0'

Piece of code from my activity class in which this problem exist:

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

I cannot understand how this update 15.0.0 doesn't have tagmanager and datalayer in it.

James Z
  • 12,209
  • 10
  • 24
  • 44
ConceptSpecs
  • 71
  • 2
  • 9

1 Answers1

5

Add this to your gradle :

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

Hope this helps!

Anonymous
  • 2,184
  • 15
  • 23
  • thankyou for solution but now it is showing tagmanager package has no datalayer and tagmanager. Earlier it was showing that gms has no tagmanager package. – ConceptSpecs Apr 14 '18 at 12:08
  • Now it is showing following error: error: cannot find symbol class DataLayer – ConceptSpecs Apr 14 '18 at 12:16
  • 1
    Please give me a thought i think it is changed in v5 api. Please check this : https://developers.google.com/tag-manager/android/v5/ Now i think implementation is changed. – ConceptSpecs Apr 14 '18 at 12:33
  • 1
    Clean your project and then gradle sync once – Anonymous Apr 14 '18 at 12:52
  • 5
    if you need the v4 api you need to add `implementation 'com.google.android.gms:play-services-tagmanager-v4-impl:15.0.0'` – petter Apr 25 '18 at 08:45