1

I have migrated to androidX using Refactor-> Migrate to AndroidX from Android Studio.

And I have upgraded my react native to 0.60.4

There after I am getting this error while building the app.

error: package android.support.annotation does not exist
import android.support.annotation.Nullable;

I found this solution, https://stackoverflow.com/a/56206103/9724247

It works too!

But these are coming from node modules, and I have too many errors like this.

Is there any way to handle these, other than manual edit ?

Thank you.

Kiran Uppunda
  • 43
  • 1
  • 6

1 Answers1

4

Follow the instructions at https://github.com/mikehardy/jetifier/blob/master/README.md to use jetifier.

Here is the summary from the readme:

1. First, use Android Studio's refactoring tool to convert your app re: the Android developer docs
2. npm install --save-dev jetifier
3. npx jetify
4. npx react-native run-android (your app should correctly compile and work)
5. Call npx jetify run in the postinstall target of your package.json (Any time your dependencies update you have to jetify again)
azundo
  • 5,902
  • 1
  • 14
  • 21