# IpSecManager.SpiUnavailableException

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# SpiUnavailableException

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/net/IpSecManager.SpiUnavailableException "View this page in Java")  

```
class SpiUnavailableException : AndroidException
```

|---|---|---|---|------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                |||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)                                                                 ||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/kotlin/java/lang/Exception.html#)                                                            |||
|   |   | ↳ | [android.util.AndroidException](https://developer.android.com/reference/kotlin/android/util/AndroidException.html#)                                     ||
|   |   |   | ↳ | [android.net.IpSecManager.SpiUnavailableException](https://developer.android.com/reference/kotlin/android/net/IpSecManager.SpiUnavailableException#) |

Thrown to indicate that a requested SPI is in use.

The combination of remote`InetAddress`and SPI must be unique across all apps on one device. If this error is encountered, a new SPI is required before a transform may be created. This error can be avoided by calling android.net.IpSecManager#allocateSecurityParameterIndex.

## Summary

|                                                                                                             Public methods                                                                                                              ||
|----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getSpi](https://developer.android.com/reference/kotlin/android/net/IpSecManager.SpiUnavailableException#getSpi())`()` Get the SPI that caused a collision. |

## Public methods

### getSpi

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getSpi(): Int
```

Get the SPI that caused a collision.