Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

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

$
0
0

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.

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>