0

Using Android Studio to build the android version of a react native app. I just received

'error: cannot find symbol class IntDef'

It's used in the following code:

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

the bottom of my dependencies block looks like this:

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

Do I need to make an import at the top of this file..or is do I need to add to the build.gradle such as implementation 'androidx.appcompat:appcompat:1.0.0'

inside the dependencies block?

I had the same issues except it was with ArrayMap, this was fixed by adding

compile "com.android.support:support-core-utils:24.2.0"

in the dependencies

Zoe
  • 27,060
  • 21
  • 118
  • 148
VK1
  • 1,676
  • 4
  • 28
  • 51

1 Answers1

4

You probably will have to include the following in your build.gradle file:

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

And the import statement in your class would be such :

import android.support.annotation.IntDef;
Zoe
  • 27,060
  • 21
  • 118
  • 148
Ashish
  • 209
  • 1
  • 10
  • I was able to get it to work by adding import androidx.annotation.IntDef; to the top of the file. I failed to realize that it was needed in two different places. Thanks for your help. – VK1 Jun 19 '19 at 04:36