android-studioannotationskeyboard-shortcutsnullableandroid-studio-3.3

Hint for @NonNull not working by pressing ALT+ENTER


I am getting problem in shortcut of Auto Insert code: ALT+ENTER

Not annotated parameter overrides @ParametersAreNonnullByDefault

Inspection info: This inspection reports problems related to @Nullable and @NotNull annotations usage configured in Constant conditions & exceptions inspection.

I know that by pressing ALT+ENTER we are getting option as below:

enter image description here

And It will annotate automatically by press ENTER.

But I am getting following options (There is no option to annotate directly)

enter image description here

Why the above image not showing option to Annotate directly.

I am using Android Studio:

Android Studio 3.3.2
Build #AI-182.5107.16.33.5314842, built on February 16, 2019
JRE: 1.8.0_152-release-1248-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.18.0-16-generic

Issue:

I have one project in PC-1 named "UserApp" created using Android Studio 3.3.1, Another Project "DriverApp" in PC-2 created using same version.

This annotation problems come up with both project but In "UserApp" its solved by updating Android Studio 3.3.2

Now I am coping "DriverApp" in PC-1 but and compiling in Android Studio 3.3.2 but getting same error as previously I got.

How can I rebuild "DriverApp" project so I get that annotation working?

I have tried:


Solution

  • I found answer as I have implemented following steps:

    You will be prompted for Scope of Inspection. That should be Whole Project.

    enter image description here

    In that you will came to know how many places need to change. By clicking on "AndroidX Annotation", It will use annotation for AndroidX.

    This problem occurred after Migration of AndroidX.

    Hope it will helps you.