简体   繁体   中英

IONIC 3 BarcodeScanner crashes android build

I get the error when build ionic project on android platform:

ionic cordova build android

this is my ionic enviroment:

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 8.0.0 

local packages:

@ionic/app-scripts : 3.1.6
Cordova Platforms  : android 7.0.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
ios-deploy        : 1.9.2 
ios-sim           : 5.0.1 
Node              : v8.9.3
npm               : 5.6.0 
OS                : macOS High Sierra
Xcode             : Xcode 9.2 Build version 9C40b 

I created the new and blank ionic project and added the native barcodescanner plugin following the commands:

$ ionic cordova plugin add phonegap-plugin-barcodescanner
$ npm install --save @ionic-native/barcode-scanner

The Android SDK build tools was updated in 27.0.3 version

anybody for help?

This is caused by an incompatibility between cordova-android 7 and the plugin. Somebody already reported it and I fixed it yesterday.

You will have to wait until those changes are released as a new version (probably 7.0.2), or install the plugin from the github url

cordova plugin add https://github.com/phonegap/phonegap-plugin-barcodescanner

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM