Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IONIC 3 BarcodeScanner crashes android build

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

ionic cordova build android
  • What went wrong: Could not resolve all files for configuration ':app:debugCompileClasspath'.

    Could not find :barcodescanner:. Searched in the following locations: file:/Users/user/Library/Android/sdk/extras/m2repository//barcodescanner//barcodescanner-.pom file:/Users/user/Library/Android/sdk/extras/m2repository//barcodescanner//barcodescanner-.aar file:/Users/user/Library/Android/sdk/extras/google/m2repository//barcodescanner//barcodescanner-.pom file:/Users/user/Library/Android/sdk/extras/google/m2repository//barcodescanner//barcodescanner-.aar file:/Users/user/Library/Android/sdk/extras/android/m2repository//barcodescanner//barcodescanner-.pom file:/Users/user/Library/Android/sdk/extras/android/m2repository//barcodescanner//barcodescanner-.aar https://jcenter.bintray.com//barcodescanner//barcodescanner-.pom https://jcenter.bintray.com//barcodescanner//barcodescanner-.aar https://maven.google.com//barcodescanner//barcodescanner-.pom https://maven.google.com//barcodescanner//barcodescanner-.aar https://repo1.maven.org/maven2//barcodescanner//barcodescanner-.pom https://repo1.maven.org/maven2//barcodescanner//barcodescanner-.aar file:/Users/user/developer/project/platforms/android/app/libs/barcodescanner-.aar file:/Users/user/developer/project/platforms/android/app/libs/barcodescanner.aar Required by: project :app

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?

like image 991
Leandro Lima Avatar asked Jan 09 '18 00:01

Leandro Lima


1 Answers

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

like image 191
jcesarmobile Avatar answered Oct 13 '22 19:10

jcesarmobile