1

I'm trying to extend a CameraCaptureSession.StateCallback. So I use Ctrl+O to select methods to be overriden. Android Studio 3.3 sees methods' parameters like platform types: session: CameraCaptureSession!.

However if I open the sources (SDK 27), I see @android.annotation.NonNull CameraCaptureSession session, where NonNull is marked by red "Cannot resolve symbol".

I've already added annotations android.annotation.NonNull and android.annotation.Nullable to Android Studio settings under "@NotNull/@Nullable problems". After that I've invalidated caches and restarted.

Code generation works the same way: parameters are nullable (session: CameraCaptureSession?).

I expect code generation make not nullable parameters in such cases (session: CameraCaptureSession).

My workaround now is to check sources of every overridden method and remove ? marks if @NotNull is presented, but it's extremely monotonous.

So are there any ideas how to fix code generation?

SerVB
  • 129
  • 17

0 Answers0