Ionic native issue in ionic app

I have a serious issue regarding ionic-native plugin. I have used ionic native camera plugin and ionic native barcode scanner plugin but I unable to use them .I am facing the same issue in both type of plugin. I have implemented it according to the documentation from https://ionicframework.com/docs/native/barcode-scanner/ and used the example from
https://dontpaniclabs.com/blog/post/2018/07/31/creating-a-barcode-scanner-app-with-ionic/!
My error is:
" Typescript Error

Argument of type ‘{ declarations: (typeof HomePage | typeof MyApp); imports: (ModuleWithProviders | typeof Browse…’ is not assignable to parameter of type ‘NgModule’. Types of property ‘providers’ are incompatible. Type ‘(typeof SplashScreen | BarcodeScannerOriginal | ToastOriginal | { provide: typeof ErrorHandler; u…’ is not assignable to type ‘Provider’. Type ‘typeof SplashScreen | BarcodeScannerOriginal | ToastOriginal | { provide: typeof ErrorHandler; us…’ is not assignable to type ‘Provider’. Type ‘BarcodeScannerOriginal’ is not assignable to type ‘Provider’. Type ‘BarcodeScannerOriginal’ is not assignable to type ‘ClassProvider’. Property ‘provide’ is missing in type ‘BarcodeScannerOriginal’.


every time i build it for android I am facing this error.

Check my solution here to solve your issue ionic native issue

No , I still have same issue.

1 Like

Did you read the whole comment on that link i shared?

Please Find Solution Already Gave Here … https://stackoverflow.com/a/54365080/3725226

yes, I have read. I uninstall my plugin and reinstalled it.

After uninstalling did you goto inside node_modules folder then @ionic-native folder then delete the plugin folder and use the command in my previous post to start a fresh install of the plugin

1 Like

yes I have followed the same steps metioned by you in your given post. Even I have remove the android platform and regenerate them but nothing happens. same issue occuring.

Check npmjs.org and check the previous version of the plugin you are trying to install and perform the step again using the method then add the version number you get from npmjs.org to it

Please try npm install @ionic-native/barcode-scanner@8.0.0

i have check its version and run command.
I am getting this


it is installig 5.0.0 version of barcode-scanner. running with only npm install @ionic-native/barcode-scanner

Most probably versions of those 2 plugins are incompatible. I had same error a long time ago then i changed versions to compatible ones. I have camera version 2.4.1 and barcode version 6.0.8

If your project is ionic v3 make sure the plugin is not installing 5.0.0 version else you will keep having more problem

Hi dotman,

I have ionic version 3.9.2, it is still installing the barcode scanner version 5.0.0, Before that I have the ionic version 4.9.0. It is installing the barcode scanner version 5.0.0 in both cases. The problem is still there.

Hey Markodemo,

I have tried these versions also but it is not able to find the version.

here is my package.json info:

{
“name”: “prop”,
“version”: “0.0.1”,
“author”: “Ionic Framework”,
“homepage”: “http://ionicframework.com/”,
“private”: true,
“scripts”: {
“start”: “ionic-app-scripts serve”,
“clean”: “ionic-app-scripts clean”,
“build”: “ionic-app-scripts build”,
“lint”: “ionic-app-scripts lint”
},
“dependencies”: {
@angular/animations”: “5.2.11”,
@angular/common”: “5.2.11”,
@angular/compiler”: “5.2.11”,
@angular/compiler-cli”: “5.2.11”,
@angular/core”: “5.2.11”,
@angular/forms”: “5.2.11”,
@angular/http”: “5.2.11”,
@angular/platform-browser”: “5.2.11”,
@angular/platform-browser-dynamic”: “5.2.11”,
@ionic-native/barcode-scanner”: “^5.0.0”,
@ionic-native/core”: “~4.18.0”,
@ionic-native/splash-screen”: “~4.18.0”,
@ionic-native/status-bar”: “~4.18.0”,
@ionic/pro”: “2.0.4”,
@ionic/storage”: “2.2.0”,
“cordova-android”: “7.1.4”,
“cordova-plugin-device”: “^2.0.2”,
“cordova-plugin-ionic-keyboard”: “^2.1.3”,
“cordova-plugin-ionic-webview”: “^2.3.2”,
“cordova-plugin-splashscreen”: “^5.0.2”,
“cordova-plugin-statusbar”: “^2.4.2”,
“cordova-plugin-whitelist”: “^1.3.3”,
“ionic”: “^3.9.2”,
“ionic-angular”: “3.9.2”,
“ionicons”: “3.0.0”,
“npm”: “^6.7.0”,
“phonegap-plugin-barcodescanner”: “8.0.1”,
“rxjs”: “5.5.11”,
“sw-toolbox”: “3.6.0”,
“zone.js”: “0.8.29”
},
“devDependencies”: {
@ionic/app-scripts”: “3.2.1”,
“typescript”: “~2.6.2”
},
“description”: “An Ionic project”,
“cordova”: {
“plugins”: {
“cordova-plugin-whitelist”: {},
“cordova-plugin-statusbar”: {},
“cordova-plugin-device”: {},
“cordova-plugin-splashscreen”: {},
“cordova-plugin-ionic-webview”: {
“ANDROID_SUPPORT_ANNOTATIONS_VERSION”: “27.+”
},
“cordova-plugin-ionic-keyboard”: {},
“phonegap-plugin-barcodescanner”: {}
},
“platforms”: [
“android”
]
}
}

You need to install and specify with @4 to get it installed

you mean, Should i install ionic 4?

1 Like

You have to uninstall it first, then goto node_modules folder then @ionic-native folder then delete the barcode scanner folder. Then go back to your terminal then run npm i @ionic-native/plugin-name@4 --save

3 Likes

yes , It worked . Thank you so much for your help.