gpt4 book ai didi

android - Unresolved reference : MasterKey

转载 作者:行者123 更新时间:2023-12-05 00:15:23 27 4
gpt4 key购买 nike

我正在尝试遵循此处给出的示例:
https://developer.android.com/topic/security/data
我在我的 gradle 中包含了所需的库:

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()
我得到 Unresolved reference :MasterKey 错误。图书馆有那个课吗?
提前致谢。

最佳答案

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

implementation "androidx.security:security-crypto:1.1.0-alpha03"
来自 release note , MasterKey在 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.

关于android - Unresolved reference : MasterKey,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67360824/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com