---
title: 'VerifyError (TabLayout & AdMob SDK)'
excerpt: 'Encountered crashes after dependency updates - fixed via ProGuard rules.'
date: 2019-07-13
categories: android
featureImage: '/images/verify-error-tab-layout-admob-sdk.webp'

prev:
  text: 'PreferenceFragmentCompat'
  link: '/blog/preferencefragmentcompat'

next:
  text: 'AssertionError: No NameTypeIndex match for SHORT_STANDARD'
  link: '/blog/short-standard-assertion-error'
---

Getting errors or crashes right after updating dependencies and pushing the update to production can be very
frustrating!

### Material Components (TabLayout)

I updated the Google Material Components library to `1.1.0-alpha07` and it worked fine.
Pushed the update to production at **2%** users.

As I have a good userbase for my apps so, I never push my apps to **100%** until I'm sure that everything is fine.

The crashes I got were 100% from `4.x` devices, a little investigation and I found that Proguard/R8 stripped
`TabLayout$Tab` class during app build process.

But, I found a solution where you'd have to keep the `TabLayout$Tab` class, so the solution was to add the following in
the proguard file –

```properties
–keep class com.google.android.material.tabs.TabLayout$Tab { *; }
```

---

### AdMob SDK

The issue I faced with updated AdMob SDK (18.1.0) was slightly different.\
I used the same as above for the missing class, here `AdView`, but still got the crash on a `4.x` emulator.

The package was – `com.google.android.gms.ads.AdView`, so I added the class in the proguard as follows –

```properties
–keep class com.google.android.gms.ads.AdView { *; }
```

But it still did not work!

I tried by removing the `AdView` and keeping the whole "ads" package & that didn't work too.

As a last resort, I kept the whole "gms" package & it worked. The final solution was –

```properties
–keep class com.google.android.gms.** { *; }
```
