---
title: 'AssertionError: No NameTypeIndex match for SHORT_STANDARD'
excerpt: 'Fixing a date implementation issue on Android.'
date: 2020-01-13
categories: android
featureImage: '/images/short-standard-assertion-error.webp'

prev:
  text: 'VerifyError (TabLayout & AdMob SDK)'
  link: '/blog/verify-error-tab-layout-admob-sdk'

next:
  text: 'Runtime Permission Fail (Vungle SDK)'
  link: '/blog/runtime-permission-fail-vungle-sdk'
---

### Experiencing Crashes on Android 8.0 or 8.1?

If your app has ever crashed with the error message `AssertionError: No NameTypeIndex match for SHORT_STANDARD`, you are
likely using `Date()` or `Calendar.getInstance()` to manage date and time. This issue is prevalent on **Android 8.0 &
8.1**.

---

Here's how you can resolve this issue by adjusting your time fetching method:

```kotlin
Date().time // or Calendar.getInstance().getTimeInMillis(); // [!code --]
Instant.now().toEpochMilli() // A more reliable solution for Android 8.0 and above // [!code ++]
```

The method `Instant.now().toEpochMilli()` offers a more stable alternative for **Android 8.0+** and helps avoid the
`AssertionError`.