gpt4 book ai didi

java - android构建错误: can't find symbol class IntDef

转载 作者:太空狗 更新时间:2023-10-29 12:59:34 61 4
gpt4 key购买 nike

使用 Android Studio 构建 Android 版本的 React Native 应用。我刚收到

'error: cannot find symbol class IntDef'

在以下代码中使用:

@IntDef(flag = true, value = { Information.BATTERY, Information.RSSI, Information.API_VERSION, Information.LED,
Information.APPLICATION_VERSION })

我的依赖项 block 的底部如下所示:

    implementation 'androidx.multidex:multidex:2.0.0'
implementation 'androidx.legacy:legacy-support-core-utils:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'

我是否需要在此文件的顶部进行导入...或者我是否需要添加到 build.gradle 中,例如 implementation 'androidx.appcompat:appcompat:1.0.0'

在依赖 block 内?

除了ArrayMap,我遇到了同样的问题,这是通过添加

解决的
compile "com.android.support:support-core-utils:24.2.0"

在依赖中

最佳答案

您可能需要在 build.gradle 文件中包含以下内容:

dependencies {
implementation 'com.android.support:support-annotations:28.0.0'
}

类中的 import 语句是这样的:

import android.support.annotation.IntDef;

关于java - android构建错误: can't find symbol class IntDef,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56660045/

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