gpt4 book ai didi

android - 推断无效永远运行

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:14:57 25 4
gpt4 key购买 nike

当我在 android studio 菜单中选择 Analyze - Infer nullity... 并选择任何范围(甚至尝试在单个文件上运行)时,弹出消息并说:

The module ... doesn't refer to the existing 'support-annotations' library with Android nullity annotations. Would you like to add dependency now?

我单击“确定”,然后开始 gradle 同步并显示带有“推断无效注释”标题的进度条。然后它像这样永远运行

我尝试在 gradle 中手动添加:

compile 'com.android.support:support-annotations:23.4.0'

但还是一样的结果。

最佳答案

我遇到了完全相同的问题,但我设法通过 Android Studio 构建选项(在 Build -> Edit Libraries and Dependencies on Mac 上找到)将最新版本的注释支持库手动添加到项目中来解决它。

这里的问题是,如果您添加版本号高于目标 API 构建的支持库,Android Studio 可能会给您某种警告,但无论如何都要添加它。不知道为什么,但这对我有用。

关于android - 推断无效永远运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37470023/

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