Android 未解析的引用:主密钥

Android 未解析的引用:主密钥,android,encryption,androidx,Android,Encryption,Androidx,我试图遵循这里给出的示例: 我已将所需的库包括在我的学位中: implementation "androidx.security:security-crypto:1.0.0" // For Identity Credential APIs implementation "androidx.security:security-identity-credential:1.0.0-alpha02" 但当我尝试使用代码时: val mainKey = Mas

我试图遵循这里给出的示例:

我已将所需的库包括在我的学位中:

implementation "androidx.security:security-crypto:1.0.0"

// For Identity Credential APIs
implementation "androidx.security:security-identity-credential:1.0.0-alpha02"
但当我尝试使用代码时:

val mainKey = MasterKey.Builder(applicationContext)
    .setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
    .build()
我得到未解析的引用:MasterKey错误。图书馆有那门课吗


提前感谢。

将库升级至最新版本(撰写本文时为1.1.0-alpha03)

从中,在版本1.1.0-alpha01上添加了主密钥

Version 1.1.0-alpha01
...
New MasterKey class provides more options for keys, also deprecating MasterKeys to support new features and versions of Android that do not have KeyGenParamSpec.
Version 1.1.0-alpha01
...
New MasterKey class provides more options for keys, also deprecating MasterKeys to support new features and versions of Android that do not have KeyGenParamSpec.