有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java 安卓生成错误:找不到符号类IntDef

使用Android Studio构建react本机应用程序的Android版本。我刚收到

'error: cannot find symbol class IntDef'

它在以下代码中使用:

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

“我的依赖项”块的底部如下所示:

    implementation '安卓x.multidex:multidex:2.0.0'
    implementation '安卓x.legacy:legacy-support-core-utils:1.0.0'
    implementation '安卓x.appcompat:appcompat:1.0.0'

是否需要在此文件顶部进行导入。。或者是我需要添加到构建中。梯度,如implementation '安卓x.appcompat:appcompat:1.0.0'

在依赖项块内部

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

compile "com.安卓.support:support-core-utils:24.2.0"

在依赖项中


共 (1) 个答案

  1. # 1 楼答案

    您可能必须在构建中包含以下内容。渐变文件:

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

    类中的import语句是这样的:

    import android.support.annotation.IntDef;