# NoCredentialException

Artifact: [androidx.credentials:credentials](https://developer.android.com/jetpack/androidx/releases/credentials) [View Source](https://cs.android.com/search?q=file:androidx/credentials/exceptions/NoCredentialException.kt+class:androidx.credentials.exceptions.NoCredentialException) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

*** ** * ** ***


```
public final class NoCredentialException extends GetCredentialException
```

<br />

|---|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||||
| ↳ | [kotlin.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) ||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) |||
|   |   | ↳ | [androidx.credentials.exceptions.GetCredentialException](https://developer.android.com/reference/androidx/credentials/exceptions/GetCredentialException) ||
|   |   |   | ↳ | [androidx.credentials.exceptions.NoCredentialException](https://developer.android.com/reference/androidx/credentials/exceptions/NoCredentialException) |

*** ** * ** ***

During the get credential flow, this is returned when no viable credential is available for the the user. This can be caused by various scenarios such as that the user doesn't have any credential or the user doesn't grant consent to using any available credential. Upon this exception, your app should navigate to use the regular app sign-up or sign-in screen. When that succeeds, you should invoke `https://developer.android.com/reference/androidx/credentials/CredentialManager#createCredential(android.content.Context,androidx.credentials.CreateCredentialRequest)` (kotlin) or `https://developer.android.com/reference/androidx/credentials/CredentialManager#createCredentialAsync(android.content.Context,androidx.credentials.CreateCredentialRequest,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.credentials.CredentialManagerCallback)` (java) to store the login info, so that your user can sign in more easily through Credential Manager the next time.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/credentials/exceptions/NoCredentialException#NoCredentialException(kotlin.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence.html errorMessage)` |

### Inherited methods

From [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html) `final void` `https://developer.android.com/reference/java/lang/Throwable.html#addSuppressed(java.lang.Throwable)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html exception)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#fillInStackTrace()()` `https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#getCause()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `@https://developer.android.com/reference/androidx/annotation/RecentlyNullable
https://developer.android.com/reference/java/lang/Throwable.html#getLocalizedMessage()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#getMessage()()` `@https://developer.android.com/reference/androidx/annotation/NonNull StackTraceElement[]` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
https://developer.android.com/reference/java/lang/Throwable.html#getStackTrace()()` `final @https://developer.android.com/reference/androidx/annotation/NonNull Throwable[]` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
https://developer.android.com/reference/java/lang/Throwable.html#getSuppressed()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#initCause(java.lang.Throwable)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html cause)` `void` `https://developer.android.com/reference/java/lang/Throwable.html#printStackTrace()()` `void` `https://developer.android.com/reference/java/lang/Throwable.html#printStackTrace(java.io.PrintStream)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/PrintStream.html s)` `void` `https://developer.android.com/reference/java/lang/Throwable.html#printStackTrace(java.io.PrintWriter)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/PrintWriter.html s)` `void` `https://developer.android.com/reference/java/lang/Throwable.html#setStackTrace(java.lang.StackTraceElement[])(@https://developer.android.com/reference/androidx/annotation/NonNull StackTraceElement[] stackTrace)`

## Public constructors

### NoCredentialException

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

```
public NoCredentialException(CharSequence errorMessage)
```