Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ionic application run error : Multiple dex files define Lcom/google/zxing/BarcodeFormat

i am developing Hybrid app using ionic. i want to use barcode scanner within it. i am installing barcode scanner plugin using https://www.thepolyglotdeveloper.com/2014/09/implement-barcode-scanner-using-ionic-framework/

plugin install successfully but after that when i try to deploye my app on android devices using command

ionic run android

I'm getting this following error

Error

Here is version list :

ionic -v  :  2.1.0

cordova -v :  6.4.0

npm -v :  2.15.9

node -v : 4.6.0

I dont know , why my project does not run in device, please help me.

Sorry for my english.

thanks in advance

like image 966
Sandip Moradiya Avatar asked Mar 07 '23 16:03

Sandip Moradiya


2 Answers

In platforms -> android ->project.properties file change

from

cordova.system.library.3=com.facebook.android:facebook-android-sdk:4.+

to

cordova.system.library.3=com.facebook.android:facebook-android-sdk:4.25.0

like image 120
chandan mishra Avatar answered Mar 11 '23 00:03

chandan mishra


Remove all plugins then have dependencies on cordova-plugin-compat, listed here: https://cordova.apache.org/news/2017/11/10/plugins-release.html

Remove plugin itself and re-install platform.

cordova plugin rm cordova-plugin-compat --force cordova platform rm android cordova platform add [email protected]

This should help.

like image 38
Denys Slieptsov Avatar answered Mar 11 '23 02:03

Denys Slieptsov