Build fails after i run the command react-native run-android. Error details are attached. Please help on this.
React-native version : 0.60

React-native version 0.60.x uses Androidx, you can replace the import android.support.annotation.NonNull with androidx.annotation.NonNull
Thank you. its working after the above change.
You can add this code into app/build.gradle file to resolve this issue automatically on every build.
task fixReactNativeVoiceImport() {
def libModule = file("../../node_modules/react-native-voice/android/src/main/java/com/wenkesj/voice/VoiceModule.java")
def fixedText = libModule.text.replace('android.support.annotation.NonNull', 'androidx.annotation.NonNull')
libModule.write(fixedText)
}
preBuild.dependsOn fixReactNativeVoiceImport
Hope it will be helpful for someone.
Most helpful comment
React-native version 0.60.x uses Androidx, you can replace the import
android.support.annotation.NonNullwithandroidx.annotation.NonNull