Getting build errors in android studio when using Native Plugins in my ionic app

i’m trying to use smsRetriver native plugin.

when i trying to build my android app i’m getting error " import android.support.annotation.NonNull; ;

please find the image below.

ionic : 6.11.8
angular: 9.1.6
node :12
android studio: 4.0.1
@capacitor/android”: “^2.3.0”,
@capacitor/core”: “2.3.0”,

auth.component.ts:

import { SmsRetriever } from '@ionic-native/sms-retriever/ngx';

  constructor( private smsRetriever: SmsRetriever ) { }

verify() {
           this.smsRetriever.startWatching().then(res => {
          alert('sms is => ' + res);
        });
}
auth.module.ts:

import { SmsRetriever } from '@ionic-native/sms-retriever/ngx';
@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    IonicModule,
    AuthPageRoutingModule
  ],
  declarations: [AuthPage],
  providers: [
    FirebaseAuthentication,
    SmsRetriever

]
})

if i uninstall smsRetriver then the error gone.

please help me on this.

Thanks in advance.

Hello,
Hope you are doing great

I am an android developer with an experience of over 5+ years and will help you resolve this issue.

Kindly reach me over maria.j@talentsfromindia.com or skype live:.cid.e0656fece75456e6

Looking forward to hear from you.

WR,
Maria

Can you please post your solution here.

I have the same problem. Did you find the solution to this?
Kindly post the solution here

Yes, in android studio

try the below options.

Analize -> infer Nullinity

this fixed my issue. i hope this will work for you.