error: package com.android.annotations does not exist

后端 未结 13 2307
南旧
南旧 2020-12-13 11:55

I have the following class

import com.android.annotations.NonNullByDefault;

@NonNullByDefault
public final class Log {
    ...
}

and here

13条回答
  •  时光取名叫无心
    2020-12-13 12:25

    You shouldn't edit any code manually jetify should do this job for you, if you are running/building from cli using react-native you dont' need to do anything but if you are running/building Andriod studio you need to run jetify as pre-build, here is how can you automate this:

    1- From the above menu go to edit configurations:

    2- Add the bottom of the screen you will find before launch click on the plus and choose Run External Tool

    2- Fill the following information, note that the working directory is your project root directory (not the android directory):

    3- Make sure this run before anything else, in the end, your configuration should look something like this:

提交回复
热议问题